db not able to catch the data
-
Of course there is no errors displaying. You catch the errors and ignore them. You have commented out the only code that would do anything in case of an error. --- b { font-weight: normal; }
-
i have uncomment the exception and it prompts Missing semicolon (;) at end of SQL statement. but i could not see anywhere to insert it as its not java ...
Dim strSQL As String = "INSERT INTO Table1 (yo,yoyo) VALUES (a,a) where user = '" + TextBox2.Text + "'"
Here values(a,a) is completely wrong one. You have to replace this intoValues('" & a & "','" & a & "')"
if the fields are string this code , if this fields are numeric it should beValues(" & a & "," & a & ")"
Regards R.Arockiapathinathan -
Dim strSQL As String = "INSERT INTO Table1 (yo,yoyo) VALUES (a,a) where user = '" + TextBox2.Text + "'"
Here values(a,a) is completely wrong one. You have to replace this intoValues('" & a & "','" & a & "')"
if the fields are string this code , if this fields are numeric it should beValues(" & a & "," & a & ")"
Regards R.Arockiapathinathanhi thx .. it solve the problem ... now i am trying update but seems to hit a different kind of problem .. Server was unable to process request. --> No value given for one or more required parameters.
Dim a As String Dim b As String Dim strSNameFont As String Dim strSNameSize As String Dim strSNameColor As String Dim strNameBold As String Dim strNameItalic As String Dim strnameunderline As String strSNameFont = ddlSNameFont.SelectedValue strSNameSize = ddlSNameSize.SelectedValue strSNameColor = ddlSNameColor.SelectedValue strNameBold = cbNameBold.Checked strNameItalic = cbNameItalic.Checked Dim i As Integer = 1 strnameunderline = "nil" a = TextBox1.Text Dim cnn As New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Temp\TDB.mdb") Dim strSQL As String = "UPDATE Settings SET NameFont = '" + strSNameFont + "', FontSize = '" + strSNameSize + _ "', FontColor = '" + strSNameColor + _ "', FBold = '" + strNameBold + _ "', FItalic = '" + strNameItalic + _ "' WHERE UserID='" + TextBox2.Text + "'" Dim cmd As New OleDbCommand(strSQL, cnn) cnn.Open() _**cmd.ExecuteNonQuery()**_ <----- in red cnn.Close() End Sub
-
hi thx .. it solve the problem ... now i am trying update but seems to hit a different kind of problem .. Server was unable to process request. --> No value given for one or more required parameters.
Dim a As String Dim b As String Dim strSNameFont As String Dim strSNameSize As String Dim strSNameColor As String Dim strNameBold As String Dim strNameItalic As String Dim strnameunderline As String strSNameFont = ddlSNameFont.SelectedValue strSNameSize = ddlSNameSize.SelectedValue strSNameColor = ddlSNameColor.SelectedValue strNameBold = cbNameBold.Checked strNameItalic = cbNameItalic.Checked Dim i As Integer = 1 strnameunderline = "nil" a = TextBox1.Text Dim cnn As New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Temp\TDB.mdb") Dim strSQL As String = "UPDATE Settings SET NameFont = '" + strSNameFont + "', FontSize = '" + strSNameSize + _ "', FontColor = '" + strSNameColor + _ "', FBold = '" + strNameBold + _ "', FItalic = '" + strNameItalic + _ "' WHERE UserID='" + TextBox2.Text + "'" Dim cmd As New OleDbCommand(strSQL, cnn) cnn.Open() _**cmd.ExecuteNonQuery()**_ <----- in red cnn.Close() End Sub
-
That means that one or more of the names in the query does not exist in the database. --- b { font-weight: normal; }
may be the tablename Settings make some problem. try like this
update [settings] ....
And also from ur code, all fields are string. Is it correct? if any of the fields are non string then remove single codes both sides. Regards R.Arockiapathinathan -
may be the tablename Settings make some problem. try like this
update [settings] ....
And also from ur code, all fields are string. Is it correct? if any of the fields are non string then remove single codes both sides. Regards R.Arockiapathinathan -
yup i checked through the database , all are string , i did not want to update the ole object so i left it out ... i tried [setting] but it prompts the same error ...
double check the field names carefully No value given for one or more required parameters Normally this error will comes when field names are wrong Regards R.Arockiapathinathan
-
double check the field names carefully No value given for one or more required parameters Normally this error will comes when field names are wrong Regards R.Arockiapathinathan
hmm the strange thing is when i query from access its fine .. then i tried retyping it .. and suddenly it works ... strange strange now i face another problem ...
Input string was not in a correct format. Exception Details: System.FormatException: Input string was not in a correct format. Source Error: Line 151: Line 152: 'set setting checkbox Line 153: cbNameBold.Checked = StoreSetting.NameBold <-- red
namebold is a get/set method ... -
hmm the strange thing is when i query from access its fine .. then i tried retyping it .. and suddenly it works ... strange strange now i face another problem ...
Input string was not in a correct format. Exception Details: System.FormatException: Input string was not in a correct format. Source Error: Line 151: Line 152: 'set setting checkbox Line 153: cbNameBold.Checked = StoreSetting.NameBold <-- red
namebold is a get/set method ...Checked property will accept only boolean value true or false. so your property should be return true or false instead of string. Regards R.Arockiapathinathan
-
Checked property will accept only boolean value true or false. so your property should be return true or false instead of string. Regards R.Arockiapathinathan