SQL Server CE 로컬 데이터베이스 (*.sdf
파일)에 데이터를 입력하는 VB.NET 프로그램을 작성하고 있습니다.SQL Server Compact에 데이터 삽입
Imports System.Data.SqlClient
Public Class Form1
Dim myConnection As SqlConnection
Dim myCommand As SqlCommand
Dim ra As Integer
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
myConnection = New SqlConnection("Data Source= Database1.sdf")
myConnection.Open()
myCommand = New SqlCommand("Insert into website('"TextBox1.Text"')", myConnection)
ra = myCommand.ExecuteNonQuery()
MessageBox.Show("Updated")
myConnection.Close()
End Sub
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
TextBox1.Text = My.Settings.SaveWebsite
End Sub
End Class
내가 컴파일하는 동안 세 가지 오류를 얻을 :
오류 1 : 문자열로 공공 서브 뉴 (cmdText '의 매개 변수를'연결 '에 대해 지정되지 인수
내 코드는 이것이다 , 연결로 으로 System.Data.SqlClient.SqlConnection, 트랜잭션으로 System.Data.SqlClient.SqlTransaction) '.
오류 2
쉼표, ')'또는 유효한 표현식 계속이 필요합니다.오류 3
'System.Data.SqlClient.SqlConnection'형식의 값을 'System.Data.SqlClient.SqlTransaction'으로 변환 할 수 없습니다.
이것은 처음 VB.NET을 사용하고 있으며 누군가 내가 잘못하고있는 것을 알기를 희망합니다. 사전에
감사
SQLCe 연결이 문제였습니다. 엄청 고마워. –