| | |
Fill DataGrid with SqlServer Table
Please support our VB.NET advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Jul 2009
Posts: 7
Reputation:
Solved Threads: 0
Ok i have this code to retreive data from a Table "Calendar" and the feild within the table are Id,Day ,Month and Year.
When i press the button to run this code and i get the error message "The parameterized query '(@Day varchar(8000),@Month varchar(8000),@Year varchar(8000))Sel' expects the parameter '@Day', which was not supplied. "
When i press the button to run this code and i get the error message "The parameterized query '(@Day varchar(8000),@Month varchar(8000),@Year varchar(8000))Sel' expects the parameter '@Day', which was not supplied. "
VB.NET Syntax (Toggle Plain Text)
Dim con As New System.Data.SqlClient.SqlConnection con.ConnectionString = ****** Dim cmd As System.Data.SqlClient.SqlCommand Dim myDA As System.Data.SqlClient.SqlDataAdapter Dim myDataSet As System.Data.DataSet 'Binding database table to DataGridView cmd = New System.Data.SqlClient.SqlCommand("Select * FROM Calendar", con) If con.State = System.Data.ConnectionState.Closed Then con.Open() myDA = New System.Data.SqlClient.SqlDataAdapter(cmd) myDataSet = New System.Data.DataSet() myDA.Fill(myDataSet, "Calendar") DataGrid.DataSource = myDataSet.Tables("Calendar").DefaultView
![]() |
Similar Threads
- Error in display multiple table record in datagrid (VB.NET)
- How to change Yes/No (True/False) results from SQL query to checkboxes in DataGrid (VB.NET)
- HELP!Populate Datagrid using ORACLE table (Visual Basic 4 / 5 / 6)
- Datagrid to draw a table (C#)
Other Threads in the VB.NET Forum
- Previous Thread: Combo Box not populating
- Next Thread: loop help
| Thread Tools | Search this Thread |
"crystal .net .net2005 30minutes 2005 2008 access arithmetic array assignment basic binary bing box button buttons center check code combobox component connectionstring convert crystalreport data database databasesearch datagrid datagridview design dissertation dissertations dissertationthesis dosconsolevb.net dropdownlist editvb.net excel file-dialog firewall folder ftp google hardcopy image images isnumericfuntioncall listview login math memory mobile ms mssqlbackend mysql navigate net networking opacity output peertopeervideostreaming picturebox picturebox1 port print printpreview problemwithinstallation project record reports" save savedialog searchbox serial soap sorting string tcp temp text textbox timer toolbox trim updown upload useraccounts usercontrol vb vb.net vb.netcode vb.nettoolboxvisualbasic2008sidebar vb2008 vbnet view visual visualbasic visualbasic.net visualstudio web wpf






ataGrid ID="DataGrid" runat="server" AutoGenerateColumn="true" SelectedIndex="1" >