Well I have gotten the code to compile.. thats good but when I Start debugging I get the following error"No mapping exists from object type System.Windows.Forms.TextBox to a known managed provider native type."
from the line:
Submit_btn.ExecuteNonQuery();
Not really sure what is causing this. Here is the code for the button
private void Submit_btn_Click(object sender, EventArgs e)
{
myconnection.Open();
SqlCommand Submit_btn = new SqlCommand("mp_submit", myconnection);
Submit_btn.CommandType = CommandType.StoredProcedure;
//Submit_btn.Parameters.AddWithValue("@Description", Desc_cb);
Submit_btn.Parameters.AddWithValue("@Call", Call_box);
Submit_btn.ExecuteNonQuery();
myconnection.Close();
}
I even commented out a line and rewrote the stored procedure and created a new table just to see if I could insert anything.
ForgottenhartPosted Aug 4, 2007, 5:56 PM
Thanks!!!
That was it.. I went back and looked at my sample code and I just went right over that when i was coding that button.
Thanks Again!!!!
Jud WhitePosted Aug 4, 2007, 5:51 PM
You can only add primitive types (or types that can be converted to primitive types) to the Parameters, it looks like you're adding the control itself (Call_box). Try Call_box.Text or whatever property is appropriate for what you're doing.