Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 2.0 > ASP.NET 2.0 Basics
Password Reminder
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
ASP.NET 2.0 Basics If you are new to ASP or ASP.NET programming with version 2.0, this is the forum to begin asking questions. Please also see the Visual Web Developer 2005 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 2.0 Basics section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old September 12th, 2007, 10:49 PM
Registered User
Join Date: Aug 2007
Location: , , Malaysia.
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default How to add a new column into gridview?

Hi everybody...
i'm the new guy here and also a new user for vb.net source code...
i want to ask about how to add a new and empty column to a gridview which can type the heading in a textbox and click a button to add the column in the runtime by using the vb.net source code?
Can anybody help me?

so far i have this code to view my data in the gridview:

        Dim ds As DataSet = New DataSet()
        Dim conn As OleDbConnection = New OleDbConnection

        Dim cmd As OleDbCommand = New OleDbCommand

        Dim DataAdapter As OleDbDataAdapter = New OleDbDataAdapter()

        conn.ConnectionString = ("Provider=microsoft.jet.oledb.4.0;data source = " & Server.MapPath("db1.mdb"))

        cmd.Connection = conn

        cmd.CommandText = "SELECT * FROM Stock"

        DataAdapter.SelectCommand = cmd
        DataAdapter.Fill(ds, "Stock")
        gv1.DataSource = ds


        DataAdapter.Fill(ds, "Stock")

        gv1.DataSource = ds

Reply With Quote

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Add new subtotal column to GridView VB nomo ASP.NET 2.0 Basics 2 March 11th, 2014 01:36 AM
Get GridView Cell Value Based on GridView Column stublair C# 2008 aka C# 3.0 0 September 4th, 2008 08:30 AM
VB.Net Gridview Column add and edit heading Bryan Stanley ASP.NET 2.0 Basics 2 August 26th, 2007 09:50 PM
Calculating Gridview Column Values rit01 ASP.NET 2.0 Professional 1 October 18th, 2006 03:46 PM
How to grab a column value from a GridView convergent7 ASP.NET 2.0 Basics 0 July 14th, 2006 12:45 AM

All times are GMT -4. The time now is 09:09 AM.

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.