c# - SQL + Cyrilic support + Parameterized Query + Multiple Choice -


OK, I still do not ask this question.

I have this code away:

  string userInput = Textbox1.text; String query = "Select books from the book, where BookName = @Title"; SqlConnection con = new SqlConnection (connectionString); SqlCommand CMD = New SQL Commands (Query, Conn.); Cmd.Parameters.AddWithValue ("title", userInput);   

And I need this query to support Cyrillic characters, and use C for 'Cyrilic support':

  From books where BookName = N'UserInput% '  

I also want'% 'because I want to get all the books that match the user input.

This test is not performed because I do not use .NET, but I probably do this Would like to do

  string UserInput = Textbox1.text; String Query = "Select * Books where BookName @Title like; SqlConnection con = New SqlConnection (connectionString); SqlCommand CMD = New SQL Commands (Query, Connection); Cmd.Parameters.AddWithValue (" Title ", UserInput +"% " );   

Change = to as in the query, add % to user input and make sure that That's the type of data for BookName in the table book, nvarchar .

Comments

Popular posts from this blog

mysql - BLOB/TEXT column 'value' used in key specification without a key length -

c# - Using Vici cool Storage with monodroid -

python - referencing a variable in another function? -