Problem with SQL table read and write
I would like help with using ADO connection to read records from SQL table, make cahnges to just user name column and reinsert record as new using stored procedures. Here is a sample code:
sqlConnention rCon = new sqlconnection ("UID......);
strSQL = "Select statement"
SqlCommand cmd = new SqlCommand(strlSQL, rCon);
SqlDataReader reader = null;
Sql Connection writeCon = new SqlConnection( "UID+....).
str2SQL = "AddNew ";
oCom = new SqlCommand(str2SQL, writeCon);
oCom.CommandType = CommandType.StoredProcedure;
reader = cmd.ExecuteReader();
areaname.Text = reader["name"].ToString();
oCom.Parameter.Add("@name", SqlDbType.VarChar, 25).Value = newname.Text;
oCom.Parameter.Add("areaname", SqlDbType.Varchar, 6).Value =areaname.Text;
if (Connection.Sate == Connection.Closed)
I cannot get any record to write. Help.