0

Using SQL Server Management Studio 2012

So i have a text box and a button, I would like to type something into the text box and have it inserted into a specific table when i click the button. Here is what i have so far.

I found something a lot easier to read

 Public Shared Sub InsertDealer(ByVal DealerName As String, _
                                ByVal DealerState As String)

    Dim dc = New DataworldDataContext.DataworldDataContext


    Try

        Dim cust As New tblDealer With {.DealerName = "John", _
 .DealerState = "TX"}
        dc.tblDealers.InsertOnSubmit(cust)
        dc.SubmitChanges()

    Catch ex As Exception
        Throw ex
    End Try

End Sub

error is "tblDealer is not defined"

Thanks

Monz
  • 139
  • 1
  • 13

1 Answers1

0

It looks like maybe you need to add the namespace to the tblDealer or us Imports to import the namespace.

Dim cust As New DataworldDataContext.tblDealer With {.DealerName = "John", _
    .DealerState = "TX"}
Greg
  • 1,984
  • 1
  • 10
  • 12