473,327 Members | 1,930 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,327 software developers and data experts.

DataGrid using a table not a DataSet

Leo
Thanks for the Help in Advance!

I am a beginner in VB.Net. I am trying to create a form which is displayed in a email for our customers to fill in a Request for quote. I would like them to type data into fields and have it added to the Datagrid

I am constantly getting the error Column 'OALen' does not belong to table .

Any Ideas
Public tblJobItems As New DataTabl

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Loa
If Not (Page.IsPostBack) The

'Sequenc
Dim Sequence As DataColumn = New DataColum
With Sequenc
.DataType = System.Type.GetType("System.Int32"
.ColumnName = "Sequence
.AllowDBNull = Fals
.ReadOnly = Tru
.AutoIncrement = Tru
End Wit
tblJobItems.Columns.Add(Sequence

'Quantit
Dim Quantity As DataColumn = New DataColum
With Quantit
.DataType = System.Type.GetType("System.Int32"
.ColumnName = "Quantity
.ReadOnly = Fals
.AutoIncrement = Fals
End Wit
tblJobItems.Columns.Add(Quantity

'FamilyTyp
Dim FamilyType As DataColumn = New DataColum
With FamilyTyp
.DataType = System.Type.GetType("System.String"
.ColumnName = "FamilyType
.ReadOnly = Fals
.AutoIncrement = Fals
.Caption = "Truss Type
End Wit
tblJobItems.Columns.Add(FamilyType

' Over All Lengt
Dim OAL As DataColumn = New DataColum
With OA
.DataType = System.Type.GetType("System.String"
.ColumnName = "OALen
.ReadOnly = Fals
.AutoIncrement = Fals
.Caption = "Over all Length
End Wit
tblJobItems.Columns.Add(OAL

'Hee
Dim Heel As DataColumn = New DataColum
With Hee
.DataType = System.Type.GetType("System.String"
.ColumnName = "Heel
.ReadOnly = Fals
.AutoIncrement = Fals
End Wit
tblJobItems.Columns.Add(Heel

'Item Descriptio
Dim Description As DataColumn = New DataColum
With Descriptio
.DataType = System.Type.GetType("System.String"
.ColumnName = "Description
.ReadOnly = Fals
.AutoIncrement = Fals
End Wit
tblJobItems.Columns.Add(Description

'Pitc
Dim Pitch As DataColumn = New DataColum
With Pitc
.DataType = System.Type.GetType("System.String"
.ColumnName = "Pitch
.ReadOnly = Fals
.AutoIncrement = Fals
End Wit
tblJobItems.Columns.Add(Pitch

'LOverHang
Dim LOverHang As DataColumn = New DataColum
With LOverHan
.DataType = System.Type.GetType("System.String"
.ColumnName = "LOH
.ReadOnly = Fals
.AutoIncrement = Fals
End Wit
tblJobItems.Columns.Add(LOverHang

'ROverHan
Dim ROverHang As DataColumn = New DataColum
With ROverHan
.DataType = System.Type.GetType("System.String"
.ColumnName = "ROH
.ReadOnly = Fals
.AutoIncrement = Fals
End Wit
tblJobItems.Columns.Add(ROverHang

'LCan
Dim LCant As DataColumn = New DataColum
With LCan
.DataType = System.Type.GetType("System.String"
.ColumnName = "LCant
.ReadOnly = Fals
.AutoIncrement = Fals
End Wit
tblJobItems.Columns.Add(LCant

'RCant
Dim RCant As DataColumn = New DataColumn
With RCant
.DataType = System.Type.GetType("System.String")
.ColumnName = "RCant"
.ReadOnly = False
.AutoIncrement = False
End With
tblJobItems.Columns.Add(RCant)

'BearingSize
Dim BearingSize As DataColumn = New DataColumn
With BearingSize
.DataType = System.Type.GetType("System.String")
.ColumnName = "BearingSize"
.ReadOnly = False
.AutoIncrement = False
End With
tblJobItems.Columns.Add(BearingSize)

'SpecialNotes
Dim SpecialNotes As DataColumn = New DataColumn
With SpecialNotes
.DataType = System.Type.GetType("System.String")
.ColumnName = "SpecialNotes"
.ReadOnly = False
.AutoIncrement = False
End With
tblJobItems.Columns.Add(SpecialNotes)
' Create an array for DataColumn objects.
Dim keys(0) As DataColumn
keys(0) = Sequence

Dim PrimaryKeyColumns(0) As DataColumn
PrimaryKeyColumns(0) = tblJobItems.Columns("Sequence")
tblJobItems.PrimaryKey = PrimaryKeyColumns
End If
DataGrid1.DataSource = tblJobItems
DataGrid1.DataBind()

End Sub

Private Sub btnADDTrussItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnADDTrussItem.Click

'Insert new row into the dataset table
Dim dr As DataRow = tblJobItems.NewRow()
dr("OALen") = tbOAL.Text
dr("Heel") = ddlHeel.SelectedValue
tblJobItems.Rows.Add(dr)
'Refresh the grid
DataGrid1.EditItemIndex = -1
End Sub
Nov 18 '05 #1
0 1340

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Morné | last post by:
Hi how do I validate a text value in a datagrid e.g. the user is only allowed to type in a Y or a N. I specifically have a problem with using the PropertyDescriptorCollection. I get the...
3
by: Diego TERCERO | last post by:
Hi... I'm working on a tool for editing text resources for a family of software product my company produces. These text resources are found in a SQL Server database, in a table called...
2
by: Wing | last post by:
Hi all, I am using Microsoft Visual Studio .NET 2003 to program my code. I have following question. I am trying to adding a few bound columns which from a dataset that containing 2 tables to...
6
by: Alpha | last post by:
I have several textboxes that I need to chang the text when the selection row is changed in a datagrid. I have the following code. This textbox displayes the initial selection but when I click on...
3
by: Jim Heavey | last post by:
Trying to figure out the technique which should be used to add rows to a datagrid. I am thinking that I would want an "Add" button on the footer, but I am not quite sure how to do that. Is that...
3
by: CVerma | last post by:
Hi, I have an embedded datagrid within a datalist. I am not able to perfrom paging in the datagrid. Any ideas? Here is my code: Here is my Simplegrid.cs file: using System; using...
5
by: junglist | last post by:
Hi guys, I've been trying to implement an editable datagrid and i have been succesful up to the point where i can update my datagrid row by row. However what used to happen was that once i updated...
7
by: Juan Romero | last post by:
Hey guys, please HELP I am going nuts with the datagrid control. I cannot get the damn control to refresh. I am using soap to get information from a web service. I have an XML writer output...
5
by: Genojoe | last post by:
I am using code from Help with two exceptions. (1) I increased the number of sample rows from 3 to 20, and (2) I anchored the datagrid to bottom of form so that I can change the size of the grid by...
17
by: A_PK | last post by:
I have problem databinding the DataGrid with DataView/DataSet after the filter... I create the following proceudre in order for user to filter as many as they want, but the following code is only...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.