473,698 Members | 2,334 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.EventArg s) Handles MyBase.Loa
If Not (Page.IsPostBac k) The

'Sequenc
Dim Sequence As DataColumn = New DataColum
With Sequenc
.DataType = System.Type.Get Type("System.In t32"
.ColumnName = "Sequence
.AllowDBNull = Fals
.ReadOnly = Tru
.AutoIncrement = Tru
End Wit
tblJobItems.Col umns.Add(Sequen ce

'Quantit
Dim Quantity As DataColumn = New DataColum
With Quantit
.DataType = System.Type.Get Type("System.In t32"
.ColumnName = "Quantity
.ReadOnly = Fals
.AutoIncrement = Fals
End Wit
tblJobItems.Col umns.Add(Quanti ty

'FamilyTyp
Dim FamilyType As DataColumn = New DataColum
With FamilyTyp
.DataType = System.Type.Get Type("System.St ring"
.ColumnName = "FamilyType
.ReadOnly = Fals
.AutoIncrement = Fals
.Caption = "Truss Type
End Wit
tblJobItems.Col umns.Add(Family Type

' Over All Lengt
Dim OAL As DataColumn = New DataColum
With OA
.DataType = System.Type.Get Type("System.St ring"
.ColumnName = "OALen
.ReadOnly = Fals
.AutoIncrement = Fals
.Caption = "Over all Length
End Wit
tblJobItems.Col umns.Add(OAL

'Hee
Dim Heel As DataColumn = New DataColum
With Hee
.DataType = System.Type.Get Type("System.St ring"
.ColumnName = "Heel
.ReadOnly = Fals
.AutoIncrement = Fals
End Wit
tblJobItems.Col umns.Add(Heel

'Item Descriptio
Dim Description As DataColumn = New DataColum
With Descriptio
.DataType = System.Type.Get Type("System.St ring"
.ColumnName = "Descriptio n
.ReadOnly = Fals
.AutoIncrement = Fals
End Wit
tblJobItems.Col umns.Add(Descri ption

'Pitc
Dim Pitch As DataColumn = New DataColum
With Pitc
.DataType = System.Type.Get Type("System.St ring"
.ColumnName = "Pitch
.ReadOnly = Fals
.AutoIncrement = Fals
End Wit
tblJobItems.Col umns.Add(Pitch

'LOverHang
Dim LOverHang As DataColumn = New DataColum
With LOverHan
.DataType = System.Type.Get Type("System.St ring"
.ColumnName = "LOH
.ReadOnly = Fals
.AutoIncrement = Fals
End Wit
tblJobItems.Col umns.Add(LOverH ang

'ROverHan
Dim ROverHang As DataColumn = New DataColum
With ROverHan
.DataType = System.Type.Get Type("System.St ring"
.ColumnName = "ROH
.ReadOnly = Fals
.AutoIncrement = Fals
End Wit
tblJobItems.Col umns.Add(ROverH ang

'LCan
Dim LCant As DataColumn = New DataColum
With LCan
.DataType = System.Type.Get Type("System.St ring"
.ColumnName = "LCant
.ReadOnly = Fals
.AutoIncrement = Fals
End Wit
tblJobItems.Col umns.Add(LCant

'RCant
Dim RCant As DataColumn = New DataColumn
With RCant
.DataType = System.Type.Get Type("System.St ring")
.ColumnName = "RCant"
.ReadOnly = False
.AutoIncrement = False
End With
tblJobItems.Col umns.Add(RCant)

'BearingSize
Dim BearingSize As DataColumn = New DataColumn
With BearingSize
.DataType = System.Type.Get Type("System.St ring")
.ColumnName = "BearingSiz e"
.ReadOnly = False
.AutoIncrement = False
End With
tblJobItems.Col umns.Add(Bearin gSize)

'SpecialNotes
Dim SpecialNotes As DataColumn = New DataColumn
With SpecialNotes
.DataType = System.Type.Get Type("System.St ring")
.ColumnName = "SpecialNot es"
.ReadOnly = False
.AutoIncrement = False
End With
tblJobItems.Col umns.Add(Specia lNotes)
' Create an array for DataColumn objects.
Dim keys(0) As DataColumn
keys(0) = Sequence

Dim PrimaryKeyColum ns(0) As DataColumn
PrimaryKeyColum ns(0) = tblJobItems.Col umns("Sequence" )
tblJobItems.Pri maryKey = PrimaryKeyColum ns
End If
DataGrid1.DataS ource = tblJobItems
DataGrid1.DataB ind()

End Sub

Private Sub btnADDTrussItem _Click(ByVal sender As System.Object, ByVal e As System.EventArg s) Handles btnADDTrussItem .Click

'Insert new row into the dataset table
Dim dr As DataRow = tblJobItems.New Row()
dr("OALen") = tbOAL.Text
dr("Heel") = ddlHeel.Selecte dValue
tblJobItems.Row s.Add(dr)
'Refresh the grid
DataGrid1.EditI temIndex = -1
End Sub
Nov 18 '05 #1
0 1358

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

Similar topics

0
3190
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 following error: "Additional information: Cannot create a child list for field Query." Below my existing code:
3
2544
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 "Resource" with the following structure : Resource{,en,fr,es} Yes.. these are the only languages supported actually. A couple of rows in that table would look like this :
2
2062
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 a datagrid, and display to the user. once I run it, I have error msg: "A field or property with the name 'PhotoName' was not found on the
6
3328
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 different rows in the datagrid, the textbox content doesn't change to reflect the change. How can I address this? Also, If the user change the text in the textbox then how do I refesh the display in the datagrid to reflect the changes? ...
3
4878
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 the best method? Do you have a sample of how to do this?
3
2781
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 System.Collections; using System.ComponentModel; using System.Data;
5
2029
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 one row, all of them were updated so i immediatelly figured out that i have to include the id of every entry in the update statement. This is where the problem is raised. My database is an Access database. The table i am updating contains a Date...
7
15440
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 the file to a folder, and then I read it back into the dataset using the dataset1.readxml. Up to this point, everything works wonderfully. The query executes, the dataset gets populated, and I get the results displayed in the datagrid.
5
5910
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 changing the size of the form The code is at the following location in the January, 2004 help ms-help://MS.VSCC.2003/MS.MSDNQTR.2004JAN.1033/cpref/html/frlrfSystemWindowsFormsDataGridClassTopic.ht You can also find it by doing a search for...
17
2756
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 allow user to filter the first time, when they tried the second time, the speficied cast error message will prompt one.... I create a mydataset1 first, and the mydataset1 data source was getting from DataGrid.DataSource.
0
8674
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8603
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9157
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8861
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7725
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6518
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5860
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
2
2329
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2001
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.