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

Visual Basic

 
GeneralRe: Help me ASAP. Pin
Christian Graus4-Apr-05 10:34
protectorChristian Graus4-Apr-05 10:34 
GeneralRe: Help me ASAP. Pin
Dave Kreskowiak4-Apr-05 14:13
mveDave Kreskowiak4-Apr-05 14:13 
GeneralRe: Help me ASAP. Pin
Christian Graus4-Apr-05 14:23
protectorChristian Graus4-Apr-05 14:23 
GeneralRe: Help me ASAP. Pin
Dave Kreskowiak4-Apr-05 16:00
mveDave Kreskowiak4-Apr-05 16:00 
GeneralAccess-- Connection String Pin
Anonymous4-Apr-05 3:30
Anonymous4-Apr-05 3:30 
GeneralRe: Access-- Connection String Pin
Jim Matthews4-Apr-05 4:47
Jim Matthews4-Apr-05 4:47 
GeneralRe: Access-- Connection String Pin
Anonymous4-Apr-05 5:10
Anonymous4-Apr-05 5:10 
GeneralRe: Access-- Connection String Pin
Jim Matthews4-Apr-05 5:30
Jim Matthews4-Apr-05 5:30 
no problem. you haven't instantiated your connection, or your dataadapter objects. try something like this...
Private con As OleDbConnection
Private  da As OleDbDataAdapter ' switch declaration for these two variables to be private. they're private by default, but it's good practice...

Private Sub Form2_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

con = New OleDBConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=E:\work\Student.mdb;User Id=Admin;Password=;")
da = New OleDBDataadapter("Select * from Users", con)

try
con.Open() 

Dim ds As DataSet
ds = New DataSet("Users")

da.Fill(ds)
DataGrid1.DataSource = ds
DataGrid1.DataMember = "Users"

catch ex as exception

messagebox.show(ex.message & environment.newline & environment.newline & ex.stacktrace, "Error")

finally

if (not con is nothing)
  con.dispose
end if

if (not ds is nothing) then
  da.dispose
end if

end try

End Sub
End Class
I haven't tested this out, so there may be some syntax errors etc. let me know how it works.





-jim
GeneralRe: Access-- Connection String Pin
Anonymous4-Apr-05 6:16
Anonymous4-Apr-05 6:16 
GeneralRe: Access-- Connection String Pin
Jim Matthews4-Apr-05 6:50
Jim Matthews4-Apr-05 6:50 
Generalhello anybody can solve it Pin
Anonymous4-Apr-05 3:17
Anonymous4-Apr-05 3:17 
GeneralRe: hello anybody can solve it Pin
Jim Matthews4-Apr-05 4:52
Jim Matthews4-Apr-05 4:52 
GeneralRe: hello anybody can solve it Pin
Anonymous4-Apr-05 19:41
Anonymous4-Apr-05 19:41 
GeneralDataset Help Pin
nitin_ion4-Apr-05 1:56
nitin_ion4-Apr-05 1:56 
GeneralXML Didn't post Pin
Colin Angus Mackay4-Apr-05 2:32
Colin Angus Mackay4-Apr-05 2:32 
GeneralRe: XML Didn't post Pin
nitin_ion4-Apr-05 17:22
nitin_ion4-Apr-05 17:22 
GeneralCPU ID and Mac address Pin
Dile4-Apr-05 1:39
Dile4-Apr-05 1:39 
GeneralRe: CPU ID and Mac address Pin
Anonymous4-Apr-05 15:21
Anonymous4-Apr-05 15:21 
GeneralCustom button Pin
kurtvandoorne4-Apr-05 1:36
kurtvandoorne4-Apr-05 1:36 
GeneralRe: Custom button Pin
Mitch F.4-Apr-05 7:49
Mitch F.4-Apr-05 7:49 
GeneralVB vs C++ for COM Development Pin
Anonymous4-Apr-05 0:02
Anonymous4-Apr-05 0:02 
GeneralSimple VB Code Pin
firestar_3x3-Apr-05 23:41
firestar_3x3-Apr-05 23:41 
GeneralCan U help me on this? Pin
abeyphier4-Apr-05 3:54
abeyphier4-Apr-05 3:54 
GeneralDatagrid Selection by Row Pin
Sniper6663-Apr-05 20:12
Sniper6663-Apr-05 20:12 
GeneralRe: Datagrid Selection by Row Pin
lata07mahi5-Apr-05 19:46
lata07mahi5-Apr-05 19:46 

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.