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

Data Grid displaying columns TWICE!

Hi,

I have 4 columns in my sql database table. I added a data adapter , data set
& a data grid to view this information. But the data grid is displaying those
4 columns TWICE , i.e in the data grid i see 8 columns.

In case this is useful, the primary key is Serial no. which is an identity
....i.e everytime a row is added to the database, it increments by1. Also,
when i configured the data adapter, it couldnt Generate the UPDATE & DELETE
statements coz it said error congiguring update & delete
statements...Though,I dont need update & delete ....

Any ideas why this data grid is diaplaying the same columns twice??
--
pmud
Jul 21 '05 #1
3 1925
Did you add columns to your datagrid (like template columns or button
columns) etc and define what fields in the table to use for these columns?

If you answered yes above check the property on the datagrid called
AutoGenerateColumns -- it is set to true by default. If it is set to true
set it to false

Corey

Setting it to

"pmud" wrote:
Hi,

I have 4 columns in my sql database table. I added a data adapter , data set
& a data grid to view this information. But the data grid is displaying those
4 columns TWICE , i.e in the data grid i see 8 columns.

In case this is useful, the primary key is Serial no. which is an identity
...i.e everytime a row is added to the database, it increments by1. Also,
when i configured the data adapter, it couldnt Generate the UPDATE & DELETE
statements coz it said error congiguring update & delete
statements...Though,I dont need update & delete ....

Any ideas why this data grid is diaplaying the same columns twice??
--
pmud

Jul 21 '05 #2
hi....

set the "AutoGenerateColumns" property of the datagrid to false.

regds
Kannan.V

"pmud" wrote:
Hi,

I have 4 columns in my sql database table. I added a data adapter , data set
& a data grid to view this information. But the data grid is displaying those
4 columns TWICE , i.e in the data grid i see 8 columns.

In case this is useful, the primary key is Serial no. which is an identity
...i.e everytime a row is added to the database, it increments by1. Also,
when i configured the data adapter, it couldnt Generate the UPDATE & DELETE
statements coz it said error congiguring update & delete
statements...Though,I dont need update & delete ....

Any ideas why this data grid is diaplaying the same columns twice??
--
pmud

Jul 21 '05 #3
ya that was what my prob was...

Thanks :))
"CoreyMas" wrote:
Did you add columns to your datagrid (like template columns or button
columns) etc and define what fields in the table to use for these columns?

If you answered yes above check the property on the datagrid called
AutoGenerateColumns -- it is set to true by default. If it is set to true
set it to false

Corey

Setting it to

"pmud" wrote:
Hi,

I have 4 columns in my sql database table. I added a data adapter , data set
& a data grid to view this information. But the data grid is displaying those
4 columns TWICE , i.e in the data grid i see 8 columns.

In case this is useful, the primary key is Serial no. which is an identity
...i.e everytime a row is added to the database, it increments by1. Also,
when i configured the data adapter, it couldnt Generate the UPDATE & DELETE
statements coz it said error congiguring update & delete
statements...Though,I dont need update & delete ....

Any ideas why this data grid is diaplaying the same columns twice??
--
pmud

Jul 21 '05 #4

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

Similar topics

2
by: Shane | last post by:
I made a Database in MS Access, and i want to try to port it over to VB.NET. One thing i have is a subform that is a datasheet. what I want to know, is there away to make the data grid to have...
2
by: Les | last post by:
Hi can anyone help me, I have just graduated and have started working for a building developer which deals with a large quantity of drawings. As you can imagine these all need documenting...
2
by: Josef Meile | last post by:
Hi, I'm using a ComboBox, some Textboxes, and a DataGrid to represent a many-to-many relationship between Person and Course. Each time that I change the value in the ComboBox (which for now is...
2
by: pmud | last post by:
Hi, I am exporting data from an EDITABLE DATA GRID EXCEL. But the 1st column in data grid is Edit Column. I want to display all columns in Excel except for the Edit column. The following...
7
by: What-a-Tool | last post by:
Have an Access table loaded into a DataTable that was created at run time, and am displaying these contents in a data grid. Me.dgGames.DataSource = Me.DsGameInfo.Tables("Games") I would like to...
5
by: Tim | last post by:
Hi, I am trying to move a datacolumn in a datatable. What I have tried so far is to create a new datacolumn set it equal to the one I want to remove and then remove it, add another column and...
3
by: pmud | last post by:
Hi, I have 4 columns in my sql database table. I added a data adapter , data set & a data grid to view this information. But the data grid is displaying those 4 columns TWICE , i.e in the data...
9
by: Anil Gupte | last post by:
After reading a tutorial and fiddling, I finally got this to work. I can now put two tables created with a DataTable class into a DataRelation. Phew! And it works! Dim tblSliceInfo As New...
6
by: slinky | last post by:
I found the following code to transfer datagrid data to an Excel file. Is this written in C#?... I'm a vb.netter. I'm just not sure where to place the code to experiment on it. Should I place it in...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.