![]() |
![]() |
![]() |
|||||
![]() |
![]() |
![]() |
![]() |
![]() |
|||
| Welcome
to Tech Support Forum home to more then 136,000 problems solved. Issues
have included: Spyware, Malware, Virus Issues, Windows, Microsoft,
Linux, Networking, Security, Hardware, and Gaming Getting your
problem solved is as easy as: 1. Registering for a free account 2. Asking your question 3. Receiving an answer Registered members: * See fewer ads. * And much more..
|
| Want to know how to post a question? click here | Having problems with spyware and pop-ups? First Steps |
|
|||||||
| Programming A discussion forum for programs and programming used in tech-related businesses. |
![]() |
|
|
LinkBack | Thread Tools |
|
|
#1 (permalink) |
|
Registered User
Join Date: May 2009
Posts: 91
OS: win xp
|
Linq insert statements
Im trying to create a program that tracks cards, basically you insert the player name, brand, year, and condition, along with the image and the linq statements i've tried haven't been working... I can query the database just fine, but if I want to insert a new row (basically saying a new card), the code shows no errors but after running and testing, the database doesn't show the row I added.....
private void SAVEbtn_Click(object sender, EventArgs e) [//these are brackets CardsSQLtoLinqDataContext db = new CardsSQLtoLinqDataContext(); Card car = new Card [ //these are brackets Player = textBox1.Text, Brand = textBox2.Text, Year = textBox3.Text, Condition = comboBox1.SelectedText }; label1.Text = textBox1.Text; // label2.Text = textBox2.Text; // label3.Text = textBox3.Text; //these are for testing purposes... db.Cards.InsertOnSubmit(car); db.SubmitChanges(); } what am I doing wrong? I've also tried CardsSQLtoLinqDataContext db = new CardsSQLtoLinqDataContext(); Card cs = new Card(); cs.Player = textBox1.Text; cs.Brand = textBox2.Text; cs.Year = textBox3.Text; cs.Condition = comboBox1.SelectedText; db.Cards.InsertOnSubmit(cs); db.SubmitChanges(); Im using Visual C# Express 2008.... also the square brackets are really curl brackets because the php page renders them into ** Last edited by mikeman22886; 06-09-2009 at 09:20 AM. |
|
|
|
| Important Information |
|
Join the #1 Tech Support Forum Today - It's Totally Free!
TechSupportForum.com is a leading support website for your computer needs. We offer free, friendly and personalized computer support. Why pay to have your computer fixed when you can do it for free. Join TechSupportforum.com Today - Click Here |
![]() |
| Thread Tools | |
|
|