| | |
Why does it insert NULL values into MySQL DB???
Please support our ASP.NET advertiser: $4.95 a Month - ASP.NET Web Hosting – Click Here!
![]() |
•
•
Join Date: Mar 2006
Posts: 11
Reputation:
Solved Threads: 0
Dim strInsert As String
Dim cmdInsert As OdbcCommand
Dim cn As OdbcConnection
cn = New _
OdbcConnection(ConfigurationSettings.AppSettings("ConnectionString"))
strInsert = "Insert into realestate.city_master(city_Name)Values(city_name);"
cmdInsert = New OdbcCommand(strInsert, cn)
cmdInsert.Parameters.Add("city_Name", city_name.Text)
cn.Open()
cmdInsert.ExecuteNonQuery()
city_name.Text = ""
cn.Close()
Dim cmdInsert As OdbcCommand
Dim cn As OdbcConnection
cn = New _
OdbcConnection(ConfigurationSettings.AppSettings("ConnectionString"))
strInsert = "Insert into realestate.city_master(city_Name)Values(city_name);"
cmdInsert = New OdbcCommand(strInsert, cn)
cmdInsert.Parameters.Add("city_Name", city_name.Text)
cn.Open()
cmdInsert.ExecuteNonQuery()
city_name.Text = ""
cn.Close()
•
•
Join Date: Jan 2007
Posts: 29
Reputation:
Solved Threads: 0
hai,
just try this out.
try this out .it worked for me. the data is getting inserted into MySQL database.
just try this out.
•
•
•
•
Dim con As OdbcConnection
Dim str As String
Dim cmd As OdbcCommand
con = New OdbcConnection
(ConfigurationSettings.AppSettings("ConnectionString"))
str = "insert into newuser_details values('" & txtusername.Text & "','" & txtpassword.Text & "')"
cmd = New OdbcCommand(str, con)
con.Open()
cmd.ExecuteNonQuery()
con.close()
![]() |
Similar Threads
- datagrid replacing null values (VB.NET)
- how to select null values in condition (MySQL)
- Exception Data is Null. This method or property cannot be called on Null values. (VB.NET)
- search (MS SQL)
- Need help diplaying null values (PHP)
- help with polymorphism and inheritance...getting null values (Java)
Other Threads in the ASP.NET Forum
- Previous Thread: Asp.net
- Next Thread: Microsoft.BusinessFramework, or one of its dependencies, was not found
| Thread Tools | Search this Thread |
.net 2.0 3.5 activexcontrol advice ajax alltypeofvideos asp asp.net bc30451 beginner bottomasp.net browser businesslogiclayer c# c#gridviewcolumn cac checkbox commonfunctions compatible confirmationcodegeneration content contenttype countryselector courier css dataaccesslayer database datagrid datagridview datagridviewcheckbox datalist development dgv dropdownlist dropdownmenu dynamically edit fileuploader fill flash flv formatdecimal forms formview gridview gudi homeedition iframe iis javascript jquery listbox menu microsoft mouse mssql multistepregistration nameisnotdeclared news objects opera panelmasterpagebuttoncontrols problem redirect registration relationaldatabases reportemail rotatepage schoolproject security serializesmo.table sessionvariables silverlight smartcard smoobjects software sql sql-server sqlserver2005 textbox tracking treeview unauthorized validatedate validation vb.net video videos virtualdirectory vista visual-studio visualstudio web webapplications webarchitecture webdevelopemnt webprogramming webservice youareanotmemberofthedebuggerusers





