473,756 Members | 2,061 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

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 racedataDataCon text
Dim newmeeting As MeetingInfo = New MeetingInfo
newmeeting.Date = Today
db.MeetingInfos .add(newmeeting )
db.SubmitChange s()

i get the following error..
Error 1 'add' is not a member of 'System.Data.Li nq.Table(Of
Race_Grabber.Me etingInfo)'.
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.Lin q
Imports System.Data.Lin q.Mapping
Dec 21 '07 #1
3 1935
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
"plonk" wrote:
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 racedataDataCon text
Dim newmeeting As MeetingInfo = New MeetingInfo
newmeeting.Date = Today
db.MeetingInfos .add(newmeeting )
db.SubmitChange s()

i get the following error..
Error 1 'add' is not a member of 'System.Data.Li nq.Table(Of
Race_Grabber.Me etingInfo)'.
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.Lin q
Imports System.Data.Lin q.Mapping
Dec 21 '07 #2
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...
Jan 21 '08 #3
Now I got it:

<a
href="http://chakkaradeep.wo rdpress.com/2007/11/22/linq-to-sql-beta-2-to-rtm-changes/">http://chakkaradeep.wo rdpress.com/2007/11/22/linq-to-sql-beta-2-to-rtm-changes/</a>

Several LINQ-to-SQL methods renamed, not least of which Add --->
InsertOnSubmit

Plonk, just replace .Add(... with .InsertOnSubmit (...
Jan 21 '08 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
1901
by: Jeremiah J. Burton | last post by:
I am trying to create a database (in Acces 2000) to track my fossil collection. I have a main table that has records for every specemen. I have a secondary table with information on localities that the specimens were collected at. The tables are linked. Each record in the specimen table will link to only 1 record in the locality table, however each locality can be linked to multiple specimens. I am trying to create a form (based on...
19
4107
by: James Fortune | last post by:
I have a lot of respect for David Fenton and Allen Browne, but I don't understand why people who know how to write code to completely replace a front end do not write something that will automate the code that implements managing unbound controls on forms given the superior performance of unbound controls in a client/server environment. I can easily understand a newbie using bound controls or someone with a tight deadline. I guess I need...
11
2804
by: my-wings | last post by:
I think I've painted myself into a corner, and I'm hoping someone can help me out. I have a table of books (tblBooks), which includes a field (strPubName) for Publisher Name and another field (strPubCity) for Publisher City. These two fields have a many-to-one relationship with tables, (tlkpPubName and tlkpPubCity) respectively. The lookup tables only have one field (strPubName and strPubCity), which is their primary key. I also have...
3
1878
by: Larry Woods | last post by:
I have a datagrid that is carrying all fields of a record...except one. Now I want to update the underlying database via a dataadapter. The update is working but the field that is "left out" is not there, of course. How do I get that field back into the datatable for the database update? TIA, Larry Woods
1
1771
by: kvazar | last post by:
What I am trying to create is basically a page with a bunch of multiple choice questions. Basically just like a test page. I am providing the code lower. All the questions that need to show as a part of the test are stored in a separate database. There is also a test file "list.txt" that has names of files from the database that I want to display. That way you don't have to manually choose the questions. All you need is to generate a text file...
10
3011
by: Mason Barge | last post by:
I have a standard POST form consisting of two types of input: text input and textarea. The form downloads current settings from a mysql database. The user can update the information by modifying the text and clicking a standard "submit" button. MAIN PROBLEM: My problem is that the information transmitted to the formhandler apparently has some sort of whitespace added to it. If I simply use trim() on the POST variable, it fails the...
3
2366
allingame
by: allingame | last post by:
Need help with append and delete duplicates I have tables namely 1)emp, 2)time and 3)payroll TABLE emp ssn text U]PK name text
8
1444
by: mvdave | last post by:
Hello all & I hope I'm posting in the right place.. I need to load a temporary table with a range of sequential dates, passing it a beginning and an end date from a criteria form. I have created the form FrmMakeDayFile with 2 unbound fields and . I simply want to be able to click a button and have a routine of some sort append records to the table tblDates with field Ddate inserted starting from txtDateFr and adding a new record for...
6
2161
by: viki1967 | last post by:
Not register double record in the DB MySQL I have developed a simple procedure asp to upload files csv and record data in the table mysql database. This procedure not register double record because I have one control existing records in the table mysql database. But if you reinsert the same file csv the rows first excluded are now registered. For example I have this rows in the file csv:
0
9325
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9152
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9930
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9716
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9716
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8569
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7116
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5180
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2542
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.