c# - i'm trying to insert to the data base but i have an error called overflow -


this code

public static void changetable(string strsql, string filename)  {      oledbconnection c = makeconnection(filename);      oledbcommand comm = new oledbcommand();      comm.commandtext = strsql;      comm.connection = c;      comm.executenonquery();      c.close();  } 

strsql = "insert h3rot(name,lastname,tlfon,nyad,email,brodcuts)" +           " values(          '          " +           textbox1.text +           "','" +           textbox2.text +           "'," +           phone +           "," +           pel +           ",'" +           textbox5.text +           "','" +           dropdownlist1.text + "          ')";  

1) code screaming out "sql injection" should really doing sanitize of textboxes. , should @ least using parameter markers instead of appending strings together.

2) you've exceeded size of 1 of columns in database. without more information in textboxes or schema of database, there's not else say.


Comments

Popular posts from this blog

c# - how to write client side events functions for the combobox items -

exception - Python, pyPdf OCR error: pyPdf.utils.PdfReadError: EOF marker not found -