473,398 Members | 2,120 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,398 software developers and data experts.

Multiple copies of the records from dataset in datagrid

54
Hello friends,
i'm populating a DataGrid with the selected records from DataSet.I'm using a Button to display the contents in dataGrid. but whenever i'm clicking the button the grid is populated with the replicas of the records from dataset.
Can anyone tel me where i'm going wrong in populating the datagrid.
Thanks in advance
Jun 1 '07 #1
6 1203
dip_developer
648 Expert 512MB
Hello friends,
i'm populating a DataGrid with the selected records from DataSet.I'm using a Button to display the contents in dataGrid. but whenever i'm clicking the button the grid is populated with the replicas of the records from dataset.
Can anyone tel me where i'm going wrong in populating the datagrid.
Thanks in advance

Can u post your code snippet please....
Jun 1 '07 #2
Munawar
12
Hello friends,
i'm populating a DataGrid with the selected records from DataSet.I'm using a Button to display the contents in dataGrid. but whenever i'm clicking the button the grid is populated with the replicas of the records from dataset.
Can anyone tel me where i'm going wrong in populating the datagrid.
Thanks in advance
The possibility for duplication could be one of the following, kindly check all these and let me know.
1- Execute same query in Query analyzer and see if there is duplication in database
2- Check if the the dataset is a page level member and you could be filling it at load as well as on button click. (mostly you could get this prob in web if you dont use IsPostBack property to check either the page is first time executing or posted back from server.

There could be more possibilities but need to know how you are fetching data and binding to grid.

Cheers
Jun 1 '07 #3
in the page load event you should call the method that is used to fill the datagrid under this statement

ie.

if not page.ispostback then

your method name()
end if

this will work
Jun 1 '07 #4
you should call your binding method that is used to fill grid under this statement in the page load event

if not page.Ispostback

methodname()
end if

call the same method under click event

bye
Jun 1 '07 #5
in page_ load event
write like this

you should use the if not page.Ispostback then

method ()

end if

this will work
Jun 1 '07 #6
sindhu
54
thaks everyone
i got the solution for this. i executed the query twice.
thanks once again for ur help:)
Jun 28 '07 #7

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Ioannis Demetriades | last post by:
Hi, I am doing a VB.NET application with SQL Server 2000 and I need to implement a database search facility that will normally return lots of records. Those records will then be displayed in a...
8
by: Hank Reed | last post by:
Hello, I have searched through dozens of old responses to this question but have been unable to make it work in my situation. I'm using Access 2000 We have a very old sticker printer on a...
1
by: Andrew | last post by:
Hey all, I am very new to ASP.Net (and .Net in general), but that isn't stopping the boss from wanting to begin new projects in it. This latest project has me kinda stumped and after a couple...
3
by: crjunk | last post by:
I have 4 different databases that I'm having to pull data from in order to populate a datagrid. I am able to do this, but my problem is that because I'm pulling the data from 4 different...
3
by: suresh | last post by:
frenz, i need to disable the add new record mode in datarid. i just want to modify the existing records in the grid...but i dont want to add new records..how do i do that? -suresh
1
by: Neil | last post by:
Hello everyone, I am making a program at the moment, and need HELP!!!. I'll start with the database, my field's r: fldSku - which a 6 digit number, no more no less (145682) fldDescription - which...
4
by: Dave Edwards | last post by:
I understand that I can fill a datagrid with multiple queries, but I cannot figure out how to fill a dataset with the same query but run against multiple SQL servers, the query , table structure...
4
by: Robert Bravery | last post by:
Hi all, I have now correctly set up my dataset and two grids, so that the parent navigates the child. THe thing is that the child table is actually a lookup type table. It lists billing types for...
7
by: =?Utf-8?B?TG9zdEluTUQ=?= | last post by:
Hi All :) I'm converting VB6 using True DBGrid Pro 8.0 to VB2005 using DataGridView. True DBGrid has a MultipleLines property that controls whether individual records span multiple lines. Is...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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: 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
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
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,...
0
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...

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.