473,473 Members | 1,894 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

How to fill the datatable without using the database?

7 New Member
i need to fill the datatable(datagridview) without using the database..
Here is my code.. But i cant able to fill the datatable
[CODE}
Public Sub CreateDatatable()
dtable = New DataTable("purchasedetails_table")

Dim column As DataColumn


column = New DataColumn()
column.DataType = System.Type.GetType("System.String")
column.ColumnName = "SNo"
column.ReadOnly = True
column.Unique = True
dtable.Columns.Add(column)

column = New DataColumn()
column.DataType = System.Type.GetType("System.String")
column.ColumnName = "Item_Name"
column.ReadOnly = True
column.Unique = True
dtable.Columns.Add(column)

column = New DataColumn()
column.DataType = System.Type.GetType("System.String")
column.ColumnName = "Req_Qty"
column.ReadOnly = True
column.Unique = True
dtable.Columns.Add(column)

column = New DataColumn()
column.DataType = System.Type.GetType("System.String")
column.ColumnName = "Req_Date"
column.ReadOnly = True
column.Unique = True
dtable.Columns.Add(column)

dset = New DataSet()
dset.Tables.Add(dtable)


End Sub

Public Sub FillDatatable()
Dim row As DataRow
Dim i As Integer
For i = 0 To DataGridView1.Rows.Count - 1
row = dtable.NewRow()
row("SNo") = i + 1
row("Item_Name") = "Item_Name" + i.ToString()
row("Req_Qty") = "Req_Qty" + i.ToString()
row("Req_Rate") = "Req_Date" + i.ToString()
dtable.Rows.Add(row)
Next i
End Sub
[/CODE}
Aug 24 '10 #1
0 1223

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Samuel R. Neff | last post by:
What options are available for doing full-text searches of database data without using a database-specific full-text engine? The only option I've found is Google's Search Appliance but it's an...
3
by: Nathan Sokalski | last post by:
I have several pieces of information (about 20 rows) that I would like to put in a DataSet to make them easier to use in my application. Because it is very little data, I would prefer not to make a...
0
by: J-T | last post by:
Thanks Here is what I am trying to do without using database : These is a simple application with the description below, can someone help me on how to create classes,collections, .... for this: ...
1
by: fiaolle | last post by:
Hi I wonder if I can make a table to an existing database without using the statement "Create Table". I want to use the Datatable with DataColumns and DataRows I have made. Is there a way I can...
1
by: vishuvv | last post by:
Is that possible to make a Crystal reports without using database/dataset in vb.net 2005
2
by: Ryan Liu | last post by:
Hi, If I have a very big view in database, it covers 15 tables, each table has 1000 columns. When I issue select * from view, the database will give error -- too many columns. Can I use a...
0
MrMancunian
by: MrMancunian | last post by:
How to create a database connection without using wizards Introduction I've seen a lot of questions on the net about getting data from, and saving data to databases. Here's a little insight how...
3
by: priyamtheone | last post by:
Is it possible to add, edit, view and delete records using a file only (instead of a database) and .Net 2005 (VB.Net/C#)? The concept is that a file that'll work more-or-less like a database. One...
3
by: Jawaddhair | last post by:
Hi All, I would like to save Gridview with all of the columns value and reload the same grid without using database??
1
by: lisles | last post by:
Can somebody tell me how to put values from a hidden field into a grid without using a database on click of add button.basically im entering some values into textboxes and i've to put these values...
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
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
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...
0
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,...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
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...

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.