Ok everyone, when I do this update clause using code behind it gives me a stupid error that says:
Line: 6
Char: 62099
Error: Sys.WebForms.Pa geRequestManage rServerErrorExc eption: Format of the initialization string does not conform to specification starting at index 0.
Code: 0
URL: http://localhost:1038/webapp/admin/assignuser.aspx
Now, my code for the SQL code behind is:
I am baffled, any idea what's wrong???
Line: 6
Char: 62099
Error: Sys.WebForms.Pa geRequestManage rServerErrorExc eption: Format of the initialization string does not conform to specification starting at index 0.
Code: 0
URL: http://localhost:1038/webapp/admin/assignuser.aspx
Now, my code for the SQL code behind is:
Code:
SqlConnection con = null;
SqlCommand cmd = null;
try
{
con = new SqlConnection();
con.ConnectionString = "SqlDataSource4";
cmd = new SqlCommand();
cmd.Connection = con;
cmd.Parameters.AddWithValue("?aspnet_id", Session["aspnet_id"]);
cmd.Parameters.AddWithValue("?contact_id", Session["contact_id"]);
cmd.Parameters.AddWithValue("?device_id", Session["device_id"]);
con.Open();
cmd.CommandText = "update egw_addressbook set aspnet_id = ?aspnet_id where contact_id = ?contact_id;";
cmd.ExecuteNonQuery();
cmd.CommandText = "update ewise_device set aspnet_id = ?aspnet_id where device_id = ?device_id;";
cmd.ExecuteNonQuery();
}
catch (Exception)
{
throw;
}
finally
{
if (con.State.Equals(ConnectionState.Open)) con.Close();
}
Comment