Since the column headings were shown I decided to test the procedure by substituting the stored procedure for a table.
When I use a DataTable instead of a DataSet the correct information is obtained from the Access database and displays fine.
The code I used is:
objConnection = New OleDbConnection ("Provider=Micr osoft.ACE.OLEDB .12.0;Data Source=C:\MyDat abase.accdb;Per sist Security Info=False;")...
User Profile
Collapse
-
No, there is no DataBind method.
Binding the data is done through the following based on what I've found so far.
DataMember - Gets or sets the name of the list or table in the data source for which the DataGridView is displaying data.
DataSource - Gets or sets the data source that the DataGridView is displaying data for.Leave a comment:
-
Sorry.
objConnection = New OleDbConnection ("Provider=Micr osoft.ACE.OLEDB .12.0;Data Source=C:\MyDat abase.accdb;Per sist Security Info=False;")
'Initialize a new instance of the OleDbCommand class.
objCommand = New OleDbCommand
'Set command object properties.
objCommand.Comm andText = "qryMyAccessQue ry"
objCommand.Comm andType...Leave a comment:
-
DataSet empty when populating from a stored procedure in Access
Hello
I'm using Visual Studio 2005 and Microsoft Access 2007 (database is saved in 2007 format).
The code which I have been using to display data in a DataGridView from a stored procedure in Microsoft Access comes from 'Beginning Visual Basic 2005 Databases' (Wrox publication).
From what I have found my code works but no records are displayed in the DataGridView. The column headings are visible but the... -
Thanks for your reply balabaster.
I tried your suggestion but the following error occurred.
'DataBind' is not a member of 'System.Windows .Forms.DataGrid View'.
Since I posted my original question I have experimented using a DataTable and linking that directly to the table in the database. When I used a DataGrid the correct information was displayed. When I went to use the DataTable with the DataGridView...Leave a comment:
-
Populating DataGridView with Access 2007 Query
Hello
I'm trying to populate a DataGridView with a stored procedure using VB.NET.
The query I need to use is within a Access 2007 datadase. When I run it in Access it is showing data but the DataGridView displays nothing.
The code I'm using to populate the DataGridView is:
------------------------------------------------------------------------------
'Create connection object.... -
Sorry, I forgot to say that I am using the command button for a windows form in Visual Studio 2005....Leave a comment:
-
Change In Command Button Appearance
Hello
I'm new to .NET and have been working through some exercises to get a bit more fluent.
I have no idea what I have done to cause command buttons to have their background appearance changed. This has happened to all previous programs as well that I have gone back over and checked, yet when I created them the command button style was different.
Originally the background of the command button was one... -
Thank you Shashi for your help.
I had created a windows application from the installed templates, then added a module and was trying to access the forms objects via procedures in the module.
After I found " 'Required by the Windows Form Designer
Private components As System.Componen tModel.IContain er"
and changed private to public as you suggested, accessing the form objects worked fine the way I have...Leave a comment:
-
Accessing Form Objects Using Module Procedures
Hello
This is my first attempt at using VB .NET, and I'm having some trouble identifying the correct means by which to access a form using a procedure stored within a module.
I've been using VBA in Excel (self taught) where for example I could access a forms textbox using the statement 'frmInput.txtAg e.Text'.
In my .NET project I have created a form with a textbox but have been unable to access it from a module...
No activity results to display
Show More
Leave a comment: