Wrox Programmer Forums
Go Back   Wrox Programmer Forums > C# and C > C# 1.0 > C#
|
C# Programming questions specific to the Microsoft C# language. See also the forum Beginning Visual C# to discuss that specific Wrox book and code.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the C# section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old June 14th, 2006, 12:52 PM
Registered User
 
Join Date: Jun 2006
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default blank rows in database

hi people,

I'm having a little trouble with a forms application. One form is bindded to a datatable and all textbox controls on the form are bindded to each field of the datatable. I use a method to insert blank rows when the user clicks a botton and then enters the text into the textboxes. the code goes like this>

DataRow row = Mydataset.Tables["Clients"].NewRow();
Mydataset.Tables["Clients"].Rows.Add(row);

The problem is that after the user commits the changes to the dataset, the last row is not entered in the db. What could be happening?

 
Old June 20th, 2006, 05:57 AM
Authorized User
 
Join Date: Apr 2006
Posts: 60
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Best is to show more of your code... Are you changing your DataSet row state by acceptingchanges or something?

 
Old June 22nd, 2006, 10:33 AM
Authorized User
 
Join Date: May 2006
Posts: 25
Thanks: 0
Thanked 0 Times in 0 Posts
Default

You might try Mydataset.AcceptChanges

Brandon
 
Old June 23rd, 2006, 12:07 PM
Authorized User
 
Join Date: Apr 2006
Posts: 60
Thanks: 0
Thanked 0 Times in 0 Posts
Default

using AcceptChanges the DataSet rows become unchanged and will not be saved in DB






Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem with adding rows to database gule2902 Visual Basic 2005 Basics 4 September 13th, 2007 05:10 PM
INSERT Multiple rows to database melkin Classic ASP Professional 3 April 10th, 2007 09:03 AM
blank rows in database MADMACZ C# 0 June 1st, 2006 10:44 AM
Delimiter for loop that may have blank rows kwerle XSLT 2 November 26th, 2003 01:25 PM
Automatically Finding and Deleting Blank rows Romulus Excel VBA 3 October 18th, 2003 09:04 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.