473,394 Members | 2,020 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Problem with Adding Rows to GridControl

I am trying to add records to a grid control. I enter in the first
record(Person A), then press add, Person A gets added. Then I try to
add another record(Person B) and Person B replaces Person A. Does
anyone have any solutions? Thanks

Carl

--
Sent via .NET Newsgroups
http://www.dotnetnewsgroups.com
May 5 '06 #1
3 1156
Try posting some snippet code
And look at your sql statement
Patrick

"Carl Maloney" <cn**********@yahoo.com> wrote in message
news:OY*************@TK2MSFTNGP04.phx.gbl...
I am trying to add records to a grid control. I enter in the first
record(Person A), then press add, Person A gets added. Then I try to
add another record(Person B) and Person B replaces Person A. Does
anyone have any solutions? Thanks

Carl

--
Sent via .NET Newsgroups
http://www.dotnetnewsgroups.com

May 5 '06 #2
Right now I do not have anything connected to a SQL database. Just
trying to add records from text boxes:

DataTable table = ds.Tables["newOrder"];
DataRow row = table.NewRow();
row["Players Name"] = fName.Text + lName.Text;
row["Jersey"] = jerNum.Text + " WA";
row["Roll"] = rollNum.Text;
row["Frame"] = sNum.Text;
table.Rows.Add(row);
indOrder.DataSource = ds.Tables["newOrder"];
indOrder.DataBind();

--
Sent via .NET Newsgroups
http://www.dotnetnewsgroups.com
May 5 '06 #3
Its possible that the line below return a new DataTable each time you try to add a new row.

DataTable table = ds.Tables["newOrder"];

Think you should debug it and find out.

Chineme Nnamdi
May 9 '06 #4

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

Similar topics

4
by: smita | last post by:
Hi, I have an xml file as below <root> <table id =1> <user>abc</user> <age>25</age> </table> <table id = 2> <user>xyz</user>
4
by: DotNetJunky | last post by:
I have built a control that runs an on-line help system. Depending on the category you selected via dropdownlist, it goes out and gets the child subcategories, and if there are any, adds a new...
0
by: sameer mowade via .NET 247 | last post by:
Hello All, I have problem while dynamically removing row from the Datagrid which i have added dynamically as shown in the following code snippet. The problem is that while removing dynamically...
0
by: Luis Esteban Valencia | last post by:
Hello I wrote a program with code behind in C# to add row into table dynamically and the program worked very well in .Net Framework 1.1. When I run this program in .Net Framework 2.0 beta...
1
by: tangus via DotNetMonster.com | last post by:
Hello all, I'm really struggling with getting some Active Directory code to work in ASP.NET. Can you please provide assistance? I am executing the following code: Dim enTry As DirectoryEntry =...
6
by: Ron L | last post by:
I have a dataset whose source is a SQL 2k stored procedure that I am trying to display in a datagrid. This datasource has 4 columns that I am interested in here, a text column and 3 value columns...
1
by: nscarnati | last post by:
I have 2 containers with objects. The veterans container contains unique objects. Each of those objects can have 1 or more corresponding card objects in the cards container. VeteranCN is...
4
by: =?Utf-8?B?TWljaGFlbCBIYWJlcmljaHRlcg==?= | last post by:
Hi, I'm adding 5 ToolStrips to a ToolStripPanel (ToolStripContainer, TopContainer) and see them ordered in three rows, starting on the left side. I want to have it in one row all. Trying to join...
2
by: mdfayazi | last post by:
I am using dataadapter to Add,Update,Delete rows in a datagridview.Update and delete are working but while adding a rows the problem comes.When I add more than one row only first row values are...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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...
0
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,...
0
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...

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.