I used database-first mode in EF. I need your help because I have a problem when I try to run this code:
private void btnSearch_Click(object sender, EventArgs e)
{
string SNumber = txtSearchByNum.Text;
var qSearchByTypeText = database.tblNote.SqlQuery("select * From tblNote Where fNumber=@t0", SNumber).ToList();
}
I get this error :
An unhandled exception of type 'System.Data.SqlClient.SqlException' occurred in System.Data.Entity.dll
Additional information: Must declare the scalar variable "@t0".
Could this be due to the ٍEntity Framework version?
you need to pass parameter like: