473,480 Members | 2,001 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

copy columns names from datagridview to dataset

13 New Member
Hi all,
I have a datagridview that has the columns set up at design time. At run time I'm creating a dataset and would like to create columns in the dataset.table based on the columns already present in the datagridview. Is there a way to do that?
Expand|Select|Wrap|Line Numbers
  1. Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
  2.         For i = 0 To dgview.Columns.Count
  3.             ds.Tables("tasklist").Columns.Add(dgview.Columns(i).Name)
  4.  
  5.         Next
  6.     End Sub
  7.  
Jan 23 '09 #1
0 1556

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

Similar topics

4
22086
by: Stropher | last post by:
I have the following: this.dataGridViewBill.DataSource = tblResult; //hide the following columns this.dataGridViewBill.Columns.Visible = false; //email this.dataGridViewBill.Columns.Visible =...
2
1473
by: BrianDH | last post by:
Hi VS 2005: C#: I have a DataGridView controls that I bind to a dataset.table froma web service. .. At design time I add my columns via the collection within the grid control. However,...
10
39444
by: Henok Girma | last post by:
Hello Gurus, I want to save the state of an unbound DataGridView on my Windows Form application to an XML file so i can later load it back.. Basically, on my form I have a DataGridView, it's got...
3
2967
by: Aspnot | last post by:
I have a form that is setup in a Master/Detail configuration. The Detail section is represented with a DataGridView. Some of the columns in this DataGridView control are unbound. When a user...
1
1447
by: pichula | last post by:
I recently started with .NET and C#. I have a stored proc in SQL Server that returns a dynamic/variable set of columns depending on the parameter I pass. I'd like to display the information in a...
5
2138
by: explode | last post by:
I made a procedure Public Sub Novo(ByVal nova1 As String, ByVal nova2 As String) that creates a new oledbDataAdapter with insert update select and delete commads. I also added that commands can...
0
6225
by: frostbb | last post by:
Ok, stumped one more time, I'm trying to learn how to use a DataGridView in place of the old DataGrid control. QUESTION: How do I map the columns returned from a RunTime sql query to the columns...
0
1623
by: anureddy | last post by:
help me how to add datagridview columns to another table,using windowsapplications. and set the displaymember and value member datagridviewcomboboxcolumn. i used this below code but that not...
1
3758
by: sbandalli | last post by:
Hi, I have a Datagridview, and it has a comboxcolumn, and textbox column, I want to bind the columns of the my datagridview to dataset, How to go with it??
0
6911
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
7091
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...
1
6743
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
6966
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...
1
4787
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...
0
4488
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
2999
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
2988
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
564
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.