solomon_13000
01-14-2007, 12:28 AM
Subscription sub = new Subscription();
sub.groupid = 1;
sub.memberid = 2;
((ArrayList)this.Session["Address"]).Add(sub);
How do I store the values in the arraylist into a database with the table name subscription using the code bellow:
SqlConnection cnn = new SqlConnection(ConfigurationManager.ConnectionStrings["myConnection"].ConnectionString);
SqlCommand myCommand = new SqlCommand();
myCommand.Connection = cnn;
myCommand.CommandText = "";
SqlDataAdapter myAdapter = new SqlDataAdapter(myCommand);
DataSet ds = new DataSet();
myAdapter.Fill(ds, "subscription");
my subscription table consist of 3 fields:
subscriptionid - pk
groupid
memberid
sub.groupid = 1;
sub.memberid = 2;
((ArrayList)this.Session["Address"]).Add(sub);
How do I store the values in the arraylist into a database with the table name subscription using the code bellow:
SqlConnection cnn = new SqlConnection(ConfigurationManager.ConnectionStrings["myConnection"].ConnectionString);
SqlCommand myCommand = new SqlCommand();
myCommand.Connection = cnn;
myCommand.CommandText = "";
SqlDataAdapter myAdapter = new SqlDataAdapter(myCommand);
DataSet ds = new DataSet();
myAdapter.Fill(ds, "subscription");
my subscription table consist of 3 fields:
subscriptionid - pk
groupid
memberid