Friday, March 16, 2012

Parameter Passing Problem - Please Help

I am trying t use a parameter(@dotnet.itags.org.modelid) with the query below but nothing is being passed from string variable model_id. What am I doing wrong?

cmdSelectCount = new SqlCommand( "SELECT COUNT(*) AS Expr1, terminal_ID.terminal_model_ID FROM terminal_ID INNER JOIN customer_cart ON terminal_ID.cart_ID = customer_cart.cart_ID WHERE terminal_ID.terminal_model_ID=@dotnet.itags.org.modelid", conPubs1 );

string model_ID = dtrResults[ "terminal_model_ID" ].ToString();

cmdSelectCount.Parameters.Add( "@dotnet.itags.org.modelid", model_id);Try this:

cmdSelectCount.parameters.Add(New System.Data.SqlClient.SqlParameter("@.modelid", System.Data.SqlDbType.NVarChar, 255))

hope this helps,
sivilian

0 comments:

Post a Comment