473,396 Members | 2,099 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,396 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 1930
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...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
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
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
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,...

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.