I have been trying to find a good tutorial/howto on this for literally weeks now and I can find lots of examples of code nothing that really explains what the heck is going on line by line. Here is my problem. I have a SQL CE file I need to be able to write and delete from. currently I have the SQL CE file linked to a couple of combo boxes and I can get them to display things in them but at some point I will need to add or remove things from the lists the combo boxes display. Can someone out there please either tell me how to do this or give me a good website that explains everything that is going on. I haven't done much coding since the days of VB5&6 so I need something that doesn't assume i know everything already. This is what i have so far but it errors out. Thanks for the help.
VB.NET:
Option Explicit On
Option Strict On
Imports System
Imports System.IO
Imports System.Data
Imports System.Data.SqlServerCe
Imports System.Data.SqlClient
Public Class CustomerEntry
Dim newCust As String = txtCustAdd.Text
Public Const ConnStr As String = "Data Source = .\Prep.sdf; File Mode=Shared Read; Persist Security Info=False"
Dim InsertQuery As String = "INSERT INTO CustomerInfo(CompanyName) Values('newCust')"
Dim myConnection As New SqlConnection
Dim myCommand As SqlCommand
Private Sub CustomerEntry_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Me.CustomerInfoTableAdapter.Fill(Me.PrepDataSet.CustomerInfo)
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
myConnection.Open(ConnStr)
myCommand = New SqlCommand(InsertQuery)
myConnection.Close()
MsgBox("Record Added")
End Sub
End Class