I want to pass a parameter 'str' in my sql query.on the basis of this parameter, the gridview in the next table will be refined. the following exception was generated-:
System.Argument Exception was unhandled
Message="No mapping exists from object type System.Data.Sql Client.SqlDataA dapter to a known managed provider native type."
Source="System. Data"Code:
SqlDataAdapter adapter = new SqlDataAdapter( "select * from [diagnose2] where area= " + @str, con);
SqlParameter param = new SqlParameter(str, adapter);
adapter.SelectCommand.Parameters.Add(param);
DataSet ds = new DataSet();
SqlCommandBuilder cmd = new SqlCommandBuilder(adapter);
adapter.Fill(ds, "[diagnose2]");