473,662 Members | 2,352 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Help with Data Tables

Ok. Brand new at this so please give a little patience and help me on the
baby steps. I'm rewriting something I did initially in PHP / MySql on a
vb.net / mysql platform. Here's what I'm doing:

1) Data is pulled from the internet and stored to a CSV file
2) Data is loaded into the database with some changes
3) All sorts of data crunching goes on.

Step one works fine -- data is saved to a csv file.
Step 2 -- The data is loaded from a CSV file into a table in a dataset. This
part works fine too. I have added a column to the table once it is full.
Code is:
DS.Tables("CSV" ).Columns.Add(" Symbol")

That works fine too. Now I want to set fill that "Symbol" column with
something of my choosing. This will change regularly. How do I do this? I
have poked around the web for quite some time. I tried using:

Dim TestCmd As New OleDb.OleDbComm and("UPDATE CSV Set Symbol = 'YHOO';")

' testing below

DA.SelectComman d = TestCmd

DS.AcceptChange s()

And that doesn't work at all. Of course I"m very new to ADO.Net and could
use some pointers here. The only tutorials I can find online are how to
create a table from scratch. I want to simply add a column and, if
possible, set the text in all the fields in this column. Eventually, I will
need to know how to take the info from this datatable and dump it into my
database, but that's for later.

Please help! Thanks.

-Scott
Mar 19 '06 #1
4 1349
I guess, on a funamental level, how do I run a standard query against a
datatable in a dataset?
Mar 19 '06 #2
Scott,

A dataset is not a database it is a from a Class instanced Object which is
very much based on OOP.

The DataSet is a collection from Relations and DataTables
A DataTable is a collection from DataColumns and DataRows (The DataColumns
descrive the items)
A DataRow exist from a collection of items.
You can inherit the dataset to give all the parts strongly typed names and
types.

Therefore the first item in the first datatable in the first dataset is

ds.table(0).row s(0).item(0) 'be aware that in this not strongly typed format
is object

I hope this gives an idea

Cor
"Scott" <sc***@scott.sc ott> schreef in bericht
news:jq******** *************** *******@comcast .com...
Ok. Brand new at this so please give a little patience and help me on the
baby steps. I'm rewriting something I did initially in PHP / MySql on a
vb.net / mysql platform. Here's what I'm doing:

1) Data is pulled from the internet and stored to a CSV file
2) Data is loaded into the database with some changes
3) All sorts of data crunching goes on.

Step one works fine -- data is saved to a csv file.
Step 2 -- The data is loaded from a CSV file into a table in a dataset.
This part works fine too. I have added a column to the table once it is
full. Code is:
DS.Tables("CSV" ).Columns.Add(" Symbol")

That works fine too. Now I want to set fill that "Symbol" column with
something of my choosing. This will change regularly. How do I do this?
I have poked around the web for quite some time. I tried using:

Dim TestCmd As New OleDb.OleDbComm and("UPDATE CSV Set Symbol = 'YHOO';")

' testing below

DA.SelectComman d = TestCmd

DS.AcceptChange s()

And that doesn't work at all. Of course I"m very new to ADO.Net and could
use some pointers here. The only tutorials I can find online are how to
create a table from scratch. I want to simply add a column and, if
possible, set the text in all the fields in this column. Eventually, I
will need to know how to take the info from this datatable and dump it
into my database, but that's for later.

Please help! Thanks.

-Scott

Mar 19 '06 #3
Scott,

The dataset has some methods to do what you want.

It is the DataTable.Selec t and the inbuild view the DefaultView.
You can make more DefaultViews and than the name becomes DataView.

There comes something new in version 9.0 what looks like a kind of logical
but free structured query language. The name of that is Linq. You probably
have seen that name already

I hope this helps,

Cor

"Scott" <sc***@scott.sc ott> schreef in bericht
news:Ds******** *************** *******@comcast .com...
I guess, on a funamental level, how do I run a standard query against a
datatable in a dataset?

Mar 19 '06 #4
That helped. Seems datatables weren't what I was hoping. I just created a
quick loop to fill in the cells for the recently created column. Now my
goal is to take this info and dump it into a mySql table that may or may not
have duplicates.

Film at 11.

Thanks.
"Cor Ligthert [MVP]" <no************ @planet.nl> wrote in message
news:%2******** ********@TK2MSF TNGP14.phx.gbl. ..
Scott,

A dataset is not a database it is a from a Class instanced Object which is
very much based on OOP.

The DataSet is a collection from Relations and DataTables
A DataTable is a collection from DataColumns and DataRows (The DataColumns
descrive the items)
A DataRow exist from a collection of items.
You can inherit the dataset to give all the parts strongly typed names and
types.

Therefore the first item in the first datatable in the first dataset is

ds.table(0).row s(0).item(0) 'be aware that in this not strongly typed
format is object

I hope this gives an idea

Cor
"Scott" <sc***@scott.sc ott> schreef in bericht
news:jq******** *************** *******@comcast .com...
Ok. Brand new at this so please give a little patience and help me on
the baby steps. I'm rewriting something I did initially in PHP / MySql
on a vb.net / mysql platform. Here's what I'm doing:

1) Data is pulled from the internet and stored to a CSV file
2) Data is loaded into the database with some changes
3) All sorts of data crunching goes on.

Step one works fine -- data is saved to a csv file.
Step 2 -- The data is loaded from a CSV file into a table in a dataset.
This part works fine too. I have added a column to the table once it is
full. Code is:
DS.Tables("CSV" ).Columns.Add(" Symbol")

That works fine too. Now I want to set fill that "Symbol" column with
something of my choosing. This will change regularly. How do I do this?
I have poked around the web for quite some time. I tried using:

Dim TestCmd As New OleDb.OleDbComm and("UPDATE CSV Set Symbol = 'YHOO';")

' testing below

DA.SelectComman d = TestCmd

DS.AcceptChange s()

And that doesn't work at all. Of course I"m very new to ADO.Net and
could use some pointers here. The only tutorials I can find online are
how to create a table from scratch. I want to simply add a column and,
if possible, set the text in all the fields in this column. Eventually,
I will need to know how to take the info from this datatable and dump it
into my database, but that's for later.

Please help! Thanks.

-Scott


Mar 19 '06 #5

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

Similar topics

0
2405
by: Mike | last post by:
Hello, I'm trying to understand how to map hierarchical XML data to relational database tables, but I seem to be missing something. I'm not a database expert, but I know the basics. XML seems so much more intuitive to me, though. Anyway, let me make up an example: Say we have an address book, in XML format, that is to be uploaded by a customer and then mapped into relational database tables. I would start by creating an XML Schema...
8
1348
by: EMW | last post by:
Hi, Could you please take a look and tell me what this means? Cor has tried to help me, but we haven't found it yet. Everytime I run this code, I get an exception error. Here is my code: Dim connStr As String = "Provider=Microsoft.JET.OLEDB.4.0;data source=" &
7
4007
by: Phin | last post by:
I need your HELP! I've seen all the posts on using Crystal Reports within vs.net (vb.net) and changing a SQL query at runtime. When I tried to pass in a dataset into the crystal report at runtime, the report still showed the results from the default query (from within the Crystal Report). Then I tried the XSD solution where you define a dataset (that mataches the database and the Crystal Report) and have the Crystal Report use this....
2
5129
by: Anita C | last post by:
Hi, How do I associate or map a specific column in a datatable to a particular element present in an xml document - to read into a datatable as well as write from the datatable to the xml element? Also, how can I associate all the attributes and their values of a particular element to the Name & Value columns of a datatable - to read into a datatable as well as write from the datatable to the xml element? Any help will be greatly...
0
3195
by: elvin | last post by:
Okay - apologize in advance for the length, but I want to make sure all you knowledgeable and helpful people have all the details you need to hopefully point my newbie rear in the right direction. I've got a fairly complex (a lot more complex than originally intended) database with three main tables. The database is designed to track information about certain files. The tables are set up with one to one relationships, primarily because...
3
2515
by: Datatable Dataset Datagrid help | last post by:
Hi I am somewhat confused, I am new at VB.net I use XML data, I have a datagrid, I created a datatable so that I can create a custom format like true is this graphic false is this graphic and others. One of the custom format is as follows: dsmessages_dt.Columns.Add("Image", GetType(Image)) I had a problem of when I used a checkbox in the grid that was bound to the datatable that it would not update my dataset. So I created another...
5
2721
by: manmit.walia | last post by:
Hello All, I am stuck on a conversion problem. I am trying to convert my application which is written in VB.NET to C# because the project I am working on currently is being written in C#. I tried my best to convert it, but somehow the app does not work. I am also not getting any errors when I complie thus, letting me know I am on the write track. Basically what I want to do is edit,add,delete, and update an XML file in a DataGrid. Below...
3
1529
by: david | last post by:
I have trouble with it. I have created a sproc in SQL Server, called SearchClass, which returns a searched key from a table. I have tested this procedure in Analyzer and it works fine. However, in the client side, when I use ExecuteNonQuery as follows --- Me.SqlConnection1.Open() classKey = Me.SqlCommand2.ExecuteNonQuery() Me.SqlConnection1.Close() --
5
2510
by: Sam | last post by:
Hi, I have one table like : MyTable {field1, field2, startdate, enddate} I want to have the count of field1 between startdate and enddate, and the count of field2 where field2 = 1 between startdate and enddate, all in the same query.
0
8343
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
8633
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...
1
6185
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
5653
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();...
0
4179
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4347
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2762
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 we have to send another system
2
1992
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1747
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.