Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Newbie SQL Server question
Message
General information
Forum:
Microsoft SQL Server
Category:
Other
Miscellaneous
Thread ID:
00997436
Message ID:
00997466
Views:
16
Sorry, but I still don't understand why you can't match the child for an update but you can match it for a delete. Maybe if you post an example of your tables things will get clearer for me.

As for your code, IMO you are missing error trapping (try/catch) and I don't think you should call Dispose directly.

>Yes, that is a valid question. I am updating an existing shopping cart product catalog on a daily basis with any modifications made to their pos system. Anyway, the way the shopping cart creates the child tables associated with the product table makes it impossible for me to match and find the correct child to update.
>
>Regarding the transaction, can you take a look at this and tell me what you think?
>static public void ExecuteLongTimeSQL(String sql, String DBConnString, int TimeoutSecs)
>{
>	System.Data.SqlClient.SqlConnection dbconn = new System.Data.SqlClient.SqlConnection();
>	dbconn.ConnectionString = DBConnString;
>	dbconn.Open();
>	SqlCommand cmd = new SqlCommand(sql,dbconn);
>	cmd.CommandTimeout = TimeoutSecs;
>	cmd.ExecuteNonQuery();
>	cmd.Dispose();
>	dbconn.Close();
>	dbconn.Dispose();
>}
Previous
Reply
Map
View

Click here to load this message in the networking platform