Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Newbie SQL Server question
Message
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Autre
Divers
Thread ID:
00997436
Message ID:
00997466
Vues:
15
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();
>}
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform