Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to pass long query string
Message
 
 
À
21/01/2013 18:33:45
Information générale
Forum:
ASP.NET
Catégorie:
Code, syntaxe and commandes
Versions des environnements
Environment:
C# 4.0
OS:
Windows 7
Network:
Windows 2003 Server
Database:
MS SQL Server
Divers
Thread ID:
01563515
Message ID:
01563565
Vues:
38
>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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform