Click here to Skip to main content
15,913,584 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: Creating Dynamic menu from database in vb.Net Pin
poonams31-Oct-07 23:21
poonams31-Oct-07 23:21 
AnswerRe: Creating Dynamic menu from database in vb.Net Pin
AliAmjad30-Oct-07 5:17
AliAmjad30-Oct-07 5:17 
GeneralRe: Creating Dynamic menu from database in vb.Net Pin
poonams30-Oct-07 21:20
poonams30-Oct-07 21:20 
QuestionRe: Creating Dynamic menu from database in vb.Net Pin
poonams2-Nov-07 2:57
poonams2-Nov-07 2:57 
QuestionReport data Pin
di3.ny2829-Oct-07 18:21
di3.ny2829-Oct-07 18:21 
Questionredirect user to requested page after session time out [modified] Pin
uglyeyes29-Oct-07 18:10
uglyeyes29-Oct-07 18:10 
AnswerRe: redirect user to requested page after session time out Pin
Dave Kreskowiak30-Oct-07 5:05
mveDave Kreskowiak30-Oct-07 5:05 
QuestionDataGridView Help... Manual Loading of ACCESS Records into DataGridView Pin
vbDigger'z29-Oct-07 17:00
vbDigger'z29-Oct-07 17:00 
DataGridView Help... Manual Loading of ACCESS Records into DataGridView

I have read such an article and code about mannual loading of records from database into datagridview not by means of "DataReader and FOR LOOP" looping process to each rows and cells to put each corresponding value..

instead? he just use an OleDataAdapter to fill a DataTable and set the "DatagridView.AutoGenerateColumns = false" then he set DataGridView.DataSource = DataTable that he made..

for him it works.. but for me i dont know what's lacking in my code.. there's no error occur but the records doesn't display inside my pre-defined column inside my datagridview.. instead? it just generate a blank row with the same rowCount of my table inside my database..

but when i set my DataGridView.AutoGenerateComlumn = true?
then it display on system way.. but not in the way i wanted it to be display inside my custom column inside the datagridview....

here's my sample code...

************
Dim oleDataAdapter1 As OleDbDataAdapter
Dim OleCommandBuilder1 As OleDbCommandBuilder
Dim dbDataSet As New DataSet()
Dim tempDataTable As DataTable = dbDataSet.Tables.Add("tempTable")

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Try
oleConnection.ConnectionString = dbConnectionString
oleConnection.Open()
oleCommand = New OleDbCommand("Select * From tempTable", oleConnection)

oleDataAdapter1 = New OleDbDataAdapter(oleCommand)
OleCommandBuilder1 = New OleDbCommandBuilder(oleDataAdapter1)

oleDataAdapter1.Fill(tempDataTable)

With DataGridView1
.AutoGenerateColumns = False
.DataSource = tempDataTable
End With

Catch ex As Exception
MsgBox(ex.ToString())
Finally
oleCommand.Connection.Close()
End Try
End Sub

**************
Note:
I have 4 column created inside the datagridview..
columnName(ID,NAME,DATE,AGE) dataType(string,string,date,number)

I know.. you can laugh at me.. just can't figured it out.. ehehe... please help...

Please anyone there who has much deeper experience and knowledge in vb programming who can help me with this??? please.. a lot of appreciation in advance... please...
AnswerRe: DataGridView Help... Manual Loading of ACCESS Records into DataGridView Pin
Dave Kreskowiak30-Oct-07 5:02
mveDave Kreskowiak30-Oct-07 5:02 
QuestionMixing VB 2005 with assembly language Pin
Orlando_Herrera29-Oct-07 9:58
Orlando_Herrera29-Oct-07 9:58 
AnswerRe: Mixing VB 2005 with assembly language Pin
nlarson1129-Oct-07 13:45
nlarson1129-Oct-07 13:45 
AnswerRe: Mixing VB 2005 with assembly language Pin
Dave Kreskowiak29-Oct-07 14:40
mveDave Kreskowiak29-Oct-07 14:40 
GeneralRe: Mixing VB 2005 with assembly language Pin
Orlando_Herrera29-Oct-07 14:55
Orlando_Herrera29-Oct-07 14:55 
GeneralRe: Mixing VB 2005 with assembly language Pin
Paul Conrad29-Oct-07 17:15
professionalPaul Conrad29-Oct-07 17:15 
GeneralRe: Mixing VB 2005 with assembly language Pin
Dave Kreskowiak29-Oct-07 18:13
mveDave Kreskowiak29-Oct-07 18:13 
GeneralRe: Mixing VB 2005 with assembly language Pin
Orlando_Herrera30-Oct-07 8:31
Orlando_Herrera30-Oct-07 8:31 
GeneralRe: Mixing VB 2005 with assembly language Pin
Dave Kreskowiak30-Oct-07 12:33
mveDave Kreskowiak30-Oct-07 12:33 
GeneralRe: Mixing VB 2005 with assembly language Pin
Orlando_Herrera31-Oct-07 5:58
Orlando_Herrera31-Oct-07 5:58 
GeneralRe: Mixing VB 2005 with assembly language Pin
Dave Kreskowiak31-Oct-07 14:51
mveDave Kreskowiak31-Oct-07 14:51 
Questionvb6 to vb.net conversion Help Pin
s3rro29-Oct-07 9:45
s3rro29-Oct-07 9:45 
AnswerRe: vb6 to vb.net conversion Help Pin
Dave Kreskowiak29-Oct-07 14:42
mveDave Kreskowiak29-Oct-07 14:42 
AnswerRe: vb6 to vb.net conversion Help Pin
nishkarsh_k29-Oct-07 14:45
nishkarsh_k29-Oct-07 14:45 
QuestionReportViewer Pin
Abbhie29-Oct-07 6:07
Abbhie29-Oct-07 6:07 
AnswerRe: ReportViewer Pin
pmarfleet29-Oct-07 7:16
pmarfleet29-Oct-07 7:16 
GeneralRe: ReportViewer Pin
Salman Sheikh29-Oct-07 22:26
Salman Sheikh29-Oct-07 22:26 

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.