473,406 Members | 2,698 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,406 software developers and data experts.

new in .net programming... insert new row in the data table

Hi Guys ... I need some help on this... i know i've followed the right
declarations on this.. or if not i may be close on hitting it. And i
know there's something wrong with this code.
This is what i did... it adds a new row into the data table... with
values like department, sales glcode etc. when i click the insert/add
button it creates a new row with the values on it. but the second time
i try to insert a new row into the datatable,(via insert/add button
click) it doesnt add another row instead it overwrites the first
value inserted... i cant see where i went wrong or what is the right
property to call (rows.add or what?).

Any Help is very much appreciated!
thanks!

Dim i As Integer

For i = 1 To 1

Row1 = WarehouseDataTable.NewRow

Row1.Item("Department") = "Department" & i

Row1.Item("Sales GL Code") = "Sales GL Code" & i

Row1.Item("Cost of Sales") = "Cost of Sales" & i

Row1.Item("Inventory") = "Inventory" & i

Row1.Item("Expense GL Code") = "Expense GL Code" & i

Row1.Item("Reader's Fee GL Code") = "Reader's Fee GL Code" & i
Row1.Item("Department") = CStr(Me.cmbDepartment.Text)

Row1.Item("Sales GL Code") = (Me.txtSalesGLCode.Text)

Row1.Item("Cost of Sales") = (Me.txtCOSGLCode.Text)

Row1.Item("Inventory") = (Me.txtInventoryGLCode.Text)

Row1.Item("Expense GL Code") = (Me.txtExpenseGLCode.Text)

Row1.Item("Reader's Fee GL Code") = (Me.txtReadersFeeGLCode.Text)

WarehouseDataTable.Rows.Add(Row1)

Next
Joel <----newbie!

Aug 31 '07 #1
2 1255
The exact solutions for your query will be found on the following URL

http://www.thescripts.com/forum/thread689604.html

This is the exact place from where your queries will be resolved
jitesh tolar
http://www.intelcs.com/IT-Companies

Aug 31 '07 #2
On Aug 31, 7:10 pm, Bond <G2jit...@gmail.comwrote:
The exact solutions for your query will be found on the following URL

http://www.thescripts.com/forum/thread689604.html

This is the exact place from where your queries will be resolved

jitesh tolarhttp://www.intelcs.com/IT-Companies
Thank you somuch for the info!

Sep 3 '07 #3

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

Similar topics

6
by: pk | last post by:
Sorry for the piece-by-piece nature of this post, I moved it from a dormant group to this one and it was 3 separate posts in the other group. Anyway... I'm trying to bulk insert a text file of...
16
by: Philip Boonzaaier | last post by:
I want to be able to generate SQL statements that will go through a list of data, effectively row by row, enquire on the database if this exists in the selected table- If it exists, then the colums...
16
by: robert | last post by:
been ruminating on the question (mostly in a 390/v7 context) of whether, and if so when, a row update becomes an insert/delete. i assume that there is a threshold on the number of columns of the...
6
by: efgh | last post by:
I'm fairly confident in my knowledge of SQL but I'm stumped with regards with an Insert Into statement in Access 2003. I've got a 4 column table that I've simplified about as much as I can, no...
23
by: Bonj | last post by:
Hi I'm looking to write an extended stored procedure, the job of which will basically to read data from one table, process it using a COM object, and write (insert) rows out to another table. I...
2
by: Geoffrey KRETZ | last post by:
Hello, I'm wondering if the following behaviour is the correct one for PostGreSQL (7.4 on UNIX). I've a table temp_tab with 5 fields (f1,f2,f3,...),and I'm a launching the following request :...
6
by: rn5a | last post by:
During registration, users are supposed to enter the following details: First Name, Last Name, EMail, UserName, Password, Confirm Password, Address, City, State, Country, Zip & Phone Number. I am...
1
by: banging | last post by:
Hi there, I have a question regarding locking of tables so that when two or more people try to write or update the mysql tables, it locks up. Basically I only want one person to write to the...
4
luckysanj
by: luckysanj | last post by:
Sir My self Alok & I want to know about good php programming concept & know about mysql database with php programming. My have one problem..I have three 3 table on mysql database. In this...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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...
0
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
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...

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.