THIS IS MY CODE PLEASE. BUT I STILLL GET THIS MESSAGE: Sqlexception was unhandled by user code Incorrect syntax near ')'.
in the code , cmd.ExecuteNonQuery() , was highlighted
please help!
Imports System.Data
Imports System.Data.SqlClient
Partial Class thesis
Inherits System.Web.UI.Page
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
End Sub
Protected Sub btnsubmit_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnsubmit.Click
Dim sqlConnection1 As New System.Data.SqlClient.SqlConnection("Data Source=EDNA-PC\SQLEXPRESS;Initial Catalog=THESIS;Integrated Security=True")
sqlConnection1.Open()
Dim cmd As New System.Data.SqlClient.SqlCommand
cmd.CommandType = System.Data.CommandType.Text
cmd.CommandText = "Insert into CinicAcc(DD, MM) Values (@DD, @MM);"
cmd.Connection = sqlConnection1
cmd.Parameters.AddWithValue("@DD", txtdd.Text)
cmd.Parameters.AddWithValue("@MM", txtmm.Text)
cmd.ExecuteNonQuery()
End Sub
End Class
Marked as answer by Chen Yu - MSFT on Nov 24, 2011 12:44 AM
oliottah
Member
30 Points
11 Posts
VWD AND MSSQL
Nov 10, 2011 02:53 AM|LINK
visual studio 2008 and 2010 which is easier and has less codes in developing applications?
anyone knows codes that will help me to link two text boxes to a database in mssql 2005 when i click on a submit button.
any help with creating reports in VWD 2008.
Thanks
ignatandrei
All-Star
134983 Points
21638 Posts
Moderator
MVP
Re: VWD AND MSSQL
Nov 10, 2011 11:57 AM|LINK
Tutorials from
http://www.asp.net/web-forms/
http://www.asp.net/mvc/
oliottah
Member
30 Points
11 Posts
Re: VWD AND MSSQL
Nov 10, 2011 07:01 PM|LINK
Hi,
Thanks for the suggestion but can u send me the codes it's quite urgent
oliottah
Member
30 Points
11 Posts
Re: VWD AND MSSQL
Nov 10, 2011 07:01 PM|LINK
Hi,
Thanks for the suggestion but can u send me the codes it's quite urgent
oliottah
Member
30 Points
11 Posts
Re: VWD AND MSSQL
Nov 10, 2011 07:01 PM|LINK
Hi,
Thanks for the suggestion but can u send me the codes it's quite urgent
oliottah
Member
30 Points
11 Posts
Re: VWD AND MSSQL
Nov 10, 2011 07:01 PM|LINK
Hi,
Thanks for the suggestion but can u send me the codes it's quite urgent
oliottah
Member
30 Points
11 Posts
Re: VWD AND MSSQL
Nov 10, 2011 07:01 PM|LINK
Hi,
Thanks for the suggestion but can u send me the codes it's quite urgent
ignatandrei
All-Star
134983 Points
21638 Posts
Moderator
MVP
Re: VWD AND MSSQL
Nov 10, 2011 07:55 PM|LINK
I do not do homeworks. Please take your time to study the tutorials from http://www.asp.net/web-forms/
oliottah
Member
30 Points
11 Posts
Re: VWD AND MSSQL
Nov 11, 2011 10:28 AM|LINK
THIS IS MY CODE PLEASE. BUT I STILLL GET THIS MESSAGE: Sqlexception was unhandled by user code Incorrect syntax near ')'.
in the code , cmd.ExecuteNonQuery() , was highlighted
please help!
Imports System.Data
Imports System.Data.SqlClient
Partial Class thesis
Inherits System.Web.UI.Page
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
End Sub
Protected Sub btnsubmit_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnsubmit.Click
Dim sqlConnection1 As New System.Data.SqlClient.SqlConnection("Data Source=EDNA-PC\SQLEXPRESS;Initial Catalog=THESIS;Integrated Security=True")
sqlConnection1.Open()
Dim cmd As New System.Data.SqlClient.SqlCommand
cmd.CommandType = System.Data.CommandType.Text
cmd.CommandText = "Insert into CinicAcc(DD, MM) Values (@DD, @MM);"
cmd.Connection = sqlConnection1
cmd.Parameters.AddWithValue("@DD", txtdd.Text)
cmd.Parameters.AddWithValue("@MM", txtmm.Text)
cmd.ExecuteNonQuery()
End Sub
End Class
Chen Yu - MS...
All-Star
21598 Points
2493 Posts
Microsoft
Re: VWD AND MSSQL
Nov 17, 2011 02:05 AM|LINK
Hi oliottah,
Your code work fine with my database. Please check them again.
Thanks.
Feedback to us
Develop and promote your apps in Windows Store