Click here to Skip to main content
15,918,108 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I am using visual studio 2015 and I need to check username and password from sql database . I am using following sql command to retrieve this information in .net application using c# as language

SQL
SELECT * FROM tbl_BankDetail where BankName=@txtBankName and BankId = @BankPassword

C#
command.Parameters.AddWithValue(@BankName;, txtBankName.Text);
command.Parameters.AddWithValue(@BankId;, txtBankPassword.Text);

I have declared the sql database column as Varchar(50) & int

I am getting the error message as
Inconvertible type mismatch between SourceColumn of String and the DataColumn of Byte

Please help, I have tried to convert the format of variable txtBankName.Text and txtBankPassword.

What I have tried:

cast function of sql to change the datatype of sql
Posted
Updated 14-Dec-16 19:29pm
v3

1 solution

 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900