سلام دوست عزیز
در اینجا باید نوع پارامتر رو ذکر کنی و در نهایت مقدار رو ست کنی
comm.Parameters.Add("@model", SqlDbType.NVarChar, 50).Value = textBox1.Text;
و در ضمن دیتا اداپتر باید حتما بهش دستور کوئری رو بدید اونی که شما نوشتید کامندی هست که نام یک پارامتر درونش هست پس قبول نمیکنه
روش ساده تره اینه
string cmd = "select * from Table where model ='" + textBox1.Text + "'";
con.Open();
SqlDataAdapter info = new SqlDataAdapter(cmd, con);
DataTable dt = new DataTable();
info.Fill(dt);
dataGridView1.DataSource = dt;
con.Close();
اگر هم با پروسیجر میخوای بنویسی از دیتا ریدر استفاده کن
https://www.csharp-station.com/Tutor...otNet/Lesson04
این خیلی بهت کمک میکنه
https://msdn.microsoft.com/en-us/library/d7125bke.aspx
SqlConnection sqlConnection1 = new SqlConnection("Your Connection String");
try
{
SqlCommand cmd = new SqlCommand();
SqlDataReader reader;
cmd.CommandText = "StoredProcedureName";
cmd.CommandType = CommandType.StoredProcedure;
cmd.Connection = sqlConnection1;
sqlConnection1.Open();
reader = cmd.ExecuteReader();
while (reader.Read())
{
// get the results of each column
string contact = (string) reader["نام ستون هات"];
string company = (string) reader["نام ستون بعدی"];
string city = (string) reader["هر چندتا ستون رو به ترتیب دریافت کن "];
reader.NextResult();
}
// data access code
}
finally
{
// 3. close the reader
if (reader != null)
{
reader.Close();
}
sqlConnection1.close(); // close the connection too }
}