Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to pass long query string
Message
 
 
To
21/01/2013 18:33:45
General information
Forum:
ASP.NET
Category:
Coding, syntax and commands
Environment versions
Environment:
C# 4.0
OS:
Windows 7
Network:
Windows 2003 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01563515
Message ID:
01563565
Views:
39
>How does the parameter get sent?
>
>>I do add parameters through Parameter statement, but the parameter uses @ in its name, e.g.
>>
>>select top (1) devicetype from dbo.pmt_type where @CardNum between Range1 and Range2
>>
>>This is my query string. I used @ to put the whole string into 1 variable.
SqlCommand sqlCommand = new SqlCommand();
                    sqlCommand.CommandText = sqlStatement;
                        
                    sqlCommand.CommandType = CommandType.Text;

                    // Add the query parameters
                    sqlCommand.Parameters.Add("@CardNum", SqlDbType.Int).Value = CardNum;
If it's not broken, fix it until it is.


My Blog
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform