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.
Jud White8 pointsPosted Aug 4, 2007, 1:51 PM EDT
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.
Forgottenhart20 pointsPosted Aug 4, 2007, 1:56 PM EDT
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!!!!