need help with adding a record to a sql database VB.net 2008


P

plonk

Hi
I'm trying to learn sql by getting a database up and running on VB.net
2008 and SQL server express.
I have the database connected correctly, (i think) but when i try to
add a record using this code..

Dim db As New racedataDataContext
Dim newmeeting As MeetingInfo = New MeetingInfo
newmeeting.Date = Today
db.MeetingInfos.add(newmeeting)
db.SubmitChanges()

i get the following error..
Error 1 'add' is not a member of 'System.Data.Linq.Table(Of
Race_Grabber.MeetingInfo)'.
I have been struggling with this for 2 days now nd cannot find a
solution. I am a noob :D

any help would be greatly appreciated.

I have the following namespaces declared:
Imports System.Data.Linq
Imports System.Data.Linq.Mapping
 
Ad

Advertisements

K

Kerry Moorman

plonk,

Are you trying to learn sql or linq or how to interact with a database via a
programming language like vb.net?

If you are trying to learn sql you certainly don't want to confuse that
issue with vb.net, linq, etc. You just need a relational database like sql
server and a tool like management studio express that will let you use sql to
interact with the database.

Kerry Moorman
 
J

Jay

Well, I don't have the answer, but I'll add this information for anyone who
might like to help both of us out:

The 'Add' method worked under Beta 2, and since I installed the release
version, every instance of adding a new row to a LINQ table in this way has
broken in my code. What you wrote should have worked, it seems, but
something has changed since Beta 2; just need to find out what. It worked so
beautifully before...
 
Ad

Advertisements


Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top