TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Sathya Narayan
NA
155
65.2k
Error in connection string
Jan 21 2014 6:03 AM
hi ,
i am getting this error that Keyword not supported: 'provider'.When i am going to connect with access database the its showing like this.
This is my connection string.
Public Const cnString As String = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=D:\sa.accdb"
This is my code
Private Sub savedata()
'On Error Resume Next
If TextBox1.Text = "" Then
MsgBox("Enter The Section")
TextBox1.Focus()
Else
Dim res = MessageBox.Show("Would You Like To Insert Section Details Record ?", "Save", MessageBoxButtons.YesNo)
If res = Windows.Forms.DialogResult.Yes Then
Dim Adapter As New SqlDataAdapter
Dim cmd1 As New SqlCommand
Dim Sql1 As String
conn = New SqlConnection(cnString)
Sql1 = "insert into SecMaster(Subject) values('" & TextBox1.Text.Replace("'", "''") & "')"
conn.Open()
Adapter.InsertCommand = New SqlCommand(Sql1, conn)
Adapter.InsertCommand.ExecuteNonQuery()
conn.Close()
Button5.Enabled = False
Button6.Enabled = False
Button2.Enabled = False
TextBox1.Enabled = False
GroupBox1.Enabled = False
clear()
End If
conn.Close()
End If
End Sub
Can any one help????
Reply
Answers (
2
)
Capture Image from webcam in C#.Net
How to break 300 KB from Html(1MB) file using C#?