Click here to Skip to main content
15,899,026 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: runtime error using new Pin
William Winner18-Mar-10 8:03
William Winner18-Mar-10 8:03 
AnswerRe: runtime error using new Pin
Luc Pattyn18-Mar-10 7:39
sitebuilderLuc Pattyn18-Mar-10 7:39 
GeneralRe: runtime error using new Pin
Daniel Engelkes18-Mar-10 7:56
Daniel Engelkes18-Mar-10 7:56 
QuestionPrivilege escalation in VB6 and VB.net programatically Pin
QuickBooksDev18-Mar-10 2:43
QuickBooksDev18-Mar-10 2:43 
AnswerRe: Privilege escalation in VB6 and VB.net programatically Pin
Dave Kreskowiak18-Mar-10 3:42
mveDave Kreskowiak18-Mar-10 3:42 
RantPrivilege Pin
εїзεїзεїз18-Mar-10 8:40
εїзεїзεїз18-Mar-10 8:40 
AnswerRe: Privilege escalation in VB6 and VB.net programatically Pin
kilkfoe119-Mar-10 7:17
kilkfoe119-Mar-10 7:17 
QuestionAdding a new row to DataSource [modified] Pin
Floodlight17-Mar-10 14:05
Floodlight17-Mar-10 14:05 
Hello all,

I have been pulling my hair our trying to get this to work.

I created a DataSource programatically and applied it to a DataGridView.

Now, I want to add rows to that DataSource programatically and have it displayed in the DataGridView, but I can't for the life of me work out how to add to the DataSource....

I know there must be a relatively simple way to do this..

I can't add data to it in the usual way because the DataGridView is bound.

Any advice is much appreciated! =)

Here's the code for creating the DataSource and adding columns to it on form.load, and showing it in my DataGridView (named "dg"). This part of the code works fine:

Dim Table1 As DataTable
        Table1 = New DataTable("Useful Links")
        '------------------------------------------------------------
        Dim adModel As DataColumn = New DataColumn("adModel")
        adModel.DataType = System.Type.GetType("System.String")
        Table1.Columns.Add(adModel)

        Dim unId As DataColumn = New DataColumn("unId")
        unId.DataType = System.Type.GetType("System.String")
        Table1.Columns.Add(unId)
        '------------------------------------------------------------
        Dim ds As New DataSet()
        ds.Tables.Add(Table1)
        dg.DataSource = Table1
        '------------------------------------------------------------


There will be a button (or something) to add rows to that DataSource.
modified on Wednesday, March 17, 2010 9:14 PM

AnswerRe: Adding a new row to DataSource Pin
Anubhava Dimri17-Mar-10 18:42
Anubhava Dimri17-Mar-10 18:42 
GeneralRe: Adding a new row to DataSource Pin
Floodlight17-Mar-10 19:06
Floodlight17-Mar-10 19:06 
GeneralRe: Adding a new row to DataSource Pin
Anubhava Dimri17-Mar-10 19:38
Anubhava Dimri17-Mar-10 19:38 
AnswerRe: Adding a new row to DataSource Pin
Dave Kreskowiak18-Mar-10 3:49
mveDave Kreskowiak18-Mar-10 3:49 
GeneralRe: Adding a new row to DataSource Pin
Floodlight18-Mar-10 12:40
Floodlight18-Mar-10 12:40 
QuestionMultiThreading in TabPages! Pin
dotnetme217-Mar-10 9:16
dotnetme217-Mar-10 9:16 
Answerpartial answer Pin
Luc Pattyn17-Mar-10 9:51
sitebuilderLuc Pattyn17-Mar-10 9:51 
GeneralRe: partial answer Pin
dotnetme217-Mar-10 10:30
dotnetme217-Mar-10 10:30 
QuestionUser Control Array [modified] ---- Solved Pin
Ibsy17-Mar-10 4:26
professionalIbsy17-Mar-10 4:26 
AnswerRe: User Control Array Pin
Dave Kreskowiak17-Mar-10 4:57
mveDave Kreskowiak17-Mar-10 4:57 
GeneralRe: User Control Array Pin
Ibsy17-Mar-10 13:47
professionalIbsy17-Mar-10 13:47 
GeneralRe: User Control Array Pin
Dave Kreskowiak17-Mar-10 14:39
mveDave Kreskowiak17-Mar-10 14:39 
Questiondecimal value in .sdf database Pin
ejaz_pk17-Mar-10 4:12
ejaz_pk17-Mar-10 4:12 
AnswerRe: decimal value in .sdf database Pin
Luc Pattyn17-Mar-10 4:18
sitebuilderLuc Pattyn17-Mar-10 4:18 
AnswerRe: decimal value in .sdf database Pin
Dave Kreskowiak17-Mar-10 4:23
mveDave Kreskowiak17-Mar-10 4:23 
AnswerRe: decimal value in .sdf database Pin
Dalek Dave17-Mar-10 4:25
professionalDalek Dave17-Mar-10 4:25 
AnswerRe: decimal value in .sdf database Pin
εїзεїзεїз17-Mar-10 6:25
εїзεїзεїз17-Mar-10 6:25 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.