|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Retrieving info out of a MDBImports System.Data.OleDb Public Class Form2 Inherits System.Windows.Forms.Form Dim cn As OleDbConnection Dim cmd As OleDbCommand Dim dr As OleDbDataReader 'WINDOWS GENERATED Private Sub Form2_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load OleDbDataAdapter1.Fill(DataSet11) End Sub Private Sub exitbutton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles exitbutton.Click Me.Close() End Sub Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Try cn = New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0; Data Source=C:\Documents and Settings\Name\Desktop\FillMe.mdb;") 'provider to be used when working with access database cn.Open() cmd = New OleDbCommand("select * from MainTable", cn) dr = cmd.ExecuteReader While dr.Read() TextBox1.Text = dr(0) TextBox2.Text = dr(1) TextBox3.Text = dr(2) 'loading data into TextBoxes by column index End While Catch End Try dr.Close() cn.Close() End Sub End Class Is filling the data set when the form loads neccisary? How would I link the Data adapters and data sets I created to this form? "John" <some***@microsoft.com> wrote in message news:jkGeh.57$1x6.49@newsfe09.lga... After reading the tutorial from http://www.startvbdotnet.com/ado/msaccess.aspx I wrote this code in an attempt to get information from my MDB file called FillMe. The only table in that Access file is called MainTable;Imports System.Data.OleDb Public Class Form2 Inherits System.Windows.Forms.Form Dim cn As OleDbConnection Dim cmd As OleDbCommand Dim dr As OleDbDataReader 'WINDOWS GENERATED Private Sub Form2_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load OleDbDataAdapter1.Fill(DataSet11) End Sub Private Sub exitbutton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles exitbutton.Click Me.Close() End Sub Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Try cn = New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0; Data Source=C:\Documents and Settings\Name\Desktop\FillMe.mdb;") 'provider to be used when working with access database cn.Open() cmd = New OleDbCommand("select * from MainTable", cn) dr = cmd.ExecuteReader While dr.Read() TextBox1.Text = dr(0) TextBox2.Text = dr(1) TextBox3.Text = dr(2) 'loading data into TextBoxes by column index End While Catch End Try dr.Close() cn.Close() End Sub End Class Is filling the data set when the form loads neccisary? You've got to fill it sometime, so why not Page_Load? How would I link the Data adapters and data sets I created to this form? OleDbDataAdapter1.Fill(DataSet11) When I click on the button, nothing happens, I dont know what is wrong
"Scott M." <s-mar@nospam.nospam> wrote in message news:e1O24j%23GHHA.3616@TK2MSFTNGP02.phx.gbl... After reading the tutorial from http://www.startvbdotnet.com/ado/msaccess.aspx I wrote this code in an attempt to get information from my MDB file called FillMe. The only table in that Access file is called MainTable;"John" <some***@microsoft.com> wrote in message news:jkGeh.57$1x6.49@newsfe09.lga... Imports System.Data.OleDb Public Class Form2 Inherits System.Windows.Forms.Form Dim cn As OleDbConnection Dim cmd As OleDbCommand Dim dr As OleDbDataReader 'WINDOWS GENERATED Private Sub Form2_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load OleDbDataAdapter1.Fill(DataSet11) End Sub Private Sub exitbutton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles exitbutton.Click Me.Close() End Sub Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Try cn = New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0; Data Source=C:\Documents and Settings\Name\Desktop\FillMe.mdb;") 'provider to be used when working with access database cn.Open() cmd = New OleDbCommand("select * from MainTable", cn) dr = cmd.ExecuteReader While dr.Read() TextBox1.Text = dr(0) TextBox2.Text = dr(1) TextBox3.Text = dr(2) 'loading data into TextBoxes by column index End While Catch End Try dr.Close() cn.Close() End Sub End Class Is filling the data set when the form loads neccisary? You've got to fill it sometime, so why not Page_Load? How would I link the Data adapters and data sets I created to this form? OleDbDataAdapter1.Fill(DataSet11) If you put a breakpoint in the code in the Button1_Click routine,
does it stop there? Or put a debug.writeline statement or something? To tell you if it ever gets there? Is this .Net 2003 or .Net 2005? Robin S. ------------- "John" <some***@microsoft.com> wrote in message news:nxIeh.79$Vq.39@newsfe12.lga... When I click on the button, nothing happens, I dont know what is wrong "Scott M." <s-mar@nospam.nospam> wrote in message news:e1O24j%23GHHA.3616@TK2MSFTNGP02.phx.gbl... After reading the tutorial from http://www.startvbdotnet.com/ado/msaccess.aspx I wrote this code in an attempt to get information from my MDB file called FillMe. The only table in that Access file is called MainTable;"John" <some***@microsoft.com> wrote in message news:jkGeh.57$1x6.49@newsfe09.lga... Imports System.Data.OleDb Public Class Form2 Inherits System.Windows.Forms.Form Dim cn As OleDbConnection Dim cmd As OleDbCommand Dim dr As OleDbDataReader 'WINDOWS GENERATED Private Sub Form2_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load OleDbDataAdapter1.Fill(DataSet11) End Sub Private Sub exitbutton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles exitbutton.Click Me.Close() End Sub Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Try cn = New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0; Data Source=C:\Documents and Settings\Name\Desktop\FillMe.mdb;") 'provider to be used when working with access database cn.Open() cmd = New OleDbCommand("select * from MainTable", cn) dr = cmd.ExecuteReader While dr.Read() TextBox1.Text = dr(0) TextBox2.Text = dr(1) TextBox3.Text = dr(2) 'loading data into TextBoxes by column index End While Catch End Try dr.Close() cn.Close() End Sub End Class Is filling the data set when the form loads neccisary? You've got to fill it sometime, so why not Page_Load? How would I link the Data adapters and data sets I created to this form? OleDbDataAdapter1.Fill(DataSet11) The breakpoints happen within the button1_click routine, but not within;
While dr.Read() TextBox1.Text = dr(0) TextBox2.Text = dr(1) TextBox3.Text = dr(2) End While I guess thats why the data is'nt being written, but I dont know how to re-write it to make it work. "RobinS" <RobinS@NoSpam.yah.none> wrote in message news:bvKdnYE0hvKrB-bYnZ2dnUVZ_o6gnZ2d@comcast.com... If you put a breakpoint in the code in the Button1_Click routine, does it stop there? Or put a debug.writeline statement or something? To tell you if it ever gets there? Is this .Net 2003 or .Net 2005? Robin S. ------------- "John" <some***@microsoft.com> wrote in message news:nxIeh.79$Vq.39@newsfe12.lga... When I click on the button, nothing happens, I dont know what is wrong "Scott M." <s-mar@nospam.nospam> wrote in message news:e1O24j%23GHHA.3616@TK2MSFTNGP02.phx.gbl... After reading the tutorial from http://www.startvbdotnet.com/ado/msaccess.aspx I wrote this code in an attempt to get information from my MDB file called FillMe. The only table in that Access file is called MainTable;"John" <some***@microsoft.com> wrote in message news:jkGeh.57$1x6.49@newsfe09.lga... Imports System.Data.OleDb Public Class Form2 Inherits System.Windows.Forms.Form Dim cn As OleDbConnection Dim cmd As OleDbCommand Dim dr As OleDbDataReader 'WINDOWS GENERATED Private Sub Form2_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load OleDbDataAdapter1.Fill(DataSet11) End Sub Private Sub exitbutton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles exitbutton.Click Me.Close() End Sub Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Try cn = New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0; Data Source=C:\Documents and Settings\Name\Desktop\FillMe.mdb;") 'provider to be used when working with access database cn.Open() cmd = New OleDbCommand("select * from MainTable", cn) dr = cmd.ExecuteReader While dr.Read() TextBox1.Text = dr(0) TextBox2.Text = dr(1) TextBox3.Text = dr(2) 'loading data into TextBoxes by column index End While Catch End Try dr.Close() cn.Close() End Sub End Class Is filling the data set when the form loads neccisary? You've got to fill it sometime, so why not Page_Load? How would I link the Data adapters and data sets I created to this form? OleDbDataAdapter1.Fill(DataSet11) What if you try just doing *one* read and filling the textboxes,
rather than looping through the data reader? Robin S. ------------------------ "John" <some***@microsoft.com> wrote in message news:9ZTeh.115$Vq.108@newsfe12.lga... The breakpoints happen within the button1_click routine, but not within;While dr.Read() TextBox1.Text = dr(0) TextBox2.Text = dr(1) TextBox3.Text = dr(2) End While I guess thats why the data is'nt being written, but I dont know how to re-write it to make it work. "RobinS" <RobinS@NoSpam.yah.none> wrote in message news:bvKdnYE0hvKrB-bYnZ2dnUVZ_o6gnZ2d@comcast.com... If you put a breakpoint in the code in the Button1_Click routine, does it stop there? Or put a debug.writeline statement or something? To tell you if it ever gets there? Is this .Net 2003 or .Net 2005? Robin S. ------------- "John" <some***@microsoft.com> wrote in message news:nxIeh.79$Vq.39@newsfe12.lga... When I click on the button, nothing happens, I dont know what is wrong "Scott M." <s-mar@nospam.nospam> wrote in message news:e1O24j%23GHHA.3616@TK2MSFTNGP02.phx.gbl... After reading the tutorial from http://www.startvbdotnet.com/ado/msaccess.aspx I wrote this code in an attempt to get information from my MDB file called FillMe. The only table in that Access file is called MainTable;"John" <some***@microsoft.com> wrote in message news:jkGeh.57$1x6.49@newsfe09.lga... Imports System.Data.OleDb Public Class Form2 Inherits System.Windows.Forms.Form Dim cn As OleDbConnection Dim cmd As OleDbCommand Dim dr As OleDbDataReader 'WINDOWS GENERATED Private Sub Form2_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load OleDbDataAdapter1.Fill(DataSet11) End Sub Private Sub exitbutton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles exitbutton.Click Me.Close() End Sub Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Try cn = New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0; Data Source=C:\Documents and Settings\Name\Desktop\FillMe.mdb;") 'provider to be used when working with access database cn.Open() cmd = New OleDbCommand("select * from MainTable", cn) dr = cmd.ExecuteReader While dr.Read() TextBox1.Text = dr(0) TextBox2.Text = dr(1) TextBox3.Text = dr(2) 'loading data into TextBoxes by column index End While Catch End Try dr.Close() cn.Close() End Sub End Class Is filling the data set when the form loads neccisary? You've got to fill it sometime, so why not Page_Load? How would I link the Data adapters and data sets I created to this form? OleDbDataAdapter1.Fill(DataSet11) John,
Wrote a complete solution in the other newsgroup you have posted too. Cor "John" <some***@microsoft.com> schreef in bericht news:9ZTeh.115$Vq.108@newsfe12.lga... The breakpoints happen within the button1_click routine, but not within;While dr.Read() TextBox1.Text = dr(0) TextBox2.Text = dr(1) TextBox3.Text = dr(2) End While I guess thats why the data is'nt being written, but I dont know how to re-write it to make it work. "RobinS" <RobinS@NoSpam.yah.none> wrote in message news:bvKdnYE0hvKrB-bYnZ2dnUVZ_o6gnZ2d@comcast.com... If you put a breakpoint in the code in the Button1_Click routine, does it stop there? Or put a debug.writeline statement or something? To tell you if it ever gets there? Is this .Net 2003 or .Net 2005? Robin S. ------------- "John" <some***@microsoft.com> wrote in message news:nxIeh.79$Vq.39@newsfe12.lga... When I click on the button, nothing happens, I dont know what is wrong "Scott M." <s-mar@nospam.nospam> wrote in message news:e1O24j%23GHHA.3616@TK2MSFTNGP02.phx.gbl... After reading the tutorial from http://www.startvbdotnet.com/ado/msaccess.aspx I wrote this code in an attempt to get information from my MDB file called FillMe. The only table in that Access file is called MainTable;"John" <some***@microsoft.com> wrote in message news:jkGeh.57$1x6.49@newsfe09.lga... Imports System.Data.OleDb Public Class Form2 Inherits System.Windows.Forms.Form Dim cn As OleDbConnection Dim cmd As OleDbCommand Dim dr As OleDbDataReader 'WINDOWS GENERATED Private Sub Form2_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load OleDbDataAdapter1.Fill(DataSet11) End Sub Private Sub exitbutton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles exitbutton.Click Me.Close() End Sub Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Try cn = New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0; Data Source=C:\Documents and Settings\Name\Desktop\FillMe.mdb;") 'provider to be used when working with access database cn.Open() cmd = New OleDbCommand("select * from MainTable", cn) dr = cmd.ExecuteReader While dr.Read() TextBox1.Text = dr(0) TextBox2.Text = dr(1) TextBox3.Text = dr(2) 'loading data into TextBoxes by column index End While Catch End Try dr.Close() cn.Close() End Sub End Class Is filling the data set when the form loads neccisary? You've got to fill it sometime, so why not Page_Load? How would I link the Data adapters and data sets I created to this form? OleDbDataAdapter1.Fill(DataSet11) thank you
"Cor Ligthert [MVP]" <notmyfirstn***@planet.nl> wrote in message news:et%23yrHIHHHA.4712@TK2MSFTNGP04.phx.gbl... Wrote a complete solution in the other newsgroup you have posted too.John, Cor "John" <some***@microsoft.com> schreef in bericht news:9ZTeh.115$Vq.108@newsfe12.lga... The breakpoints happen within the button1_click routine, but not within;While dr.Read() TextBox1.Text = dr(0) TextBox2.Text = dr(1) TextBox3.Text = dr(2) End While I guess thats why the data is'nt being written, but I dont know how to re-write it to make it work. "RobinS" <RobinS@NoSpam.yah.none> wrote in message news:bvKdnYE0hvKrB-bYnZ2dnUVZ_o6gnZ2d@comcast.com... If you put a breakpoint in the code in the Button1_Click routine, does it stop there? Or put a debug.writeline statement or something? To tell you if it ever gets there? Is this .Net 2003 or .Net 2005? Robin S. ------------- "John" <some***@microsoft.com> wrote in message news:nxIeh.79$Vq.39@newsfe12.lga... When I click on the button, nothing happens, I dont know what is wrong "Scott M." <s-mar@nospam.nospam> wrote in message news:e1O24j%23GHHA.3616@TK2MSFTNGP02.phx.gbl... After reading the tutorial from http://www.startvbdotnet.com/ado/msaccess.aspx I wrote this code in an attempt to get information from my MDB file called FillMe. The only table in that Access file is called MainTable;"John" <some***@microsoft.com> wrote in message news:jkGeh.57$1x6.49@newsfe09.lga... Imports System.Data.OleDb Public Class Form2 Inherits System.Windows.Forms.Form Dim cn As OleDbConnection Dim cmd As OleDbCommand Dim dr As OleDbDataReader 'WINDOWS GENERATED Private Sub Form2_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load OleDbDataAdapter1.Fill(DataSet11) End Sub Private Sub exitbutton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles exitbutton.Click Me.Close() End Sub Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Try cn = New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0; Data Source=C:\Documents and Settings\Name\Desktop\FillMe.mdb;") 'provider to be used when working with access database cn.Open() cmd = New OleDbCommand("select * from MainTable", cn) dr = cmd.ExecuteReader While dr.Read() TextBox1.Text = dr(0) TextBox2.Text = dr(1) TextBox3.Text = dr(2) 'loading data into TextBoxes by column index End While Catch End Try dr.Close() cn.Close() End Sub End Class Is filling the data set when the form loads neccisary? You've got to fill it sometime, so why not Page_Load? How would I link the Data adapters and data sets I created to this form? OleDbDataAdapter1.Fill(DataSet11)
Commercial copy protection?
Why I am sick of .Net Need some help... Merging Java and VB for alert box Retrieve Hard Disk Serial Number or othe unique PC identifier - XP & 2K This code demonstrates a problem using a treeview twice Looking for suggestions on how to do something How to get the registry key permission using RegistryRight in NET2.0? slow form backimage load @ vb.net Newbie: Assigning values to an array |
|||||||||||||||||||||||