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

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.OleDbCommand("UPDATE CSV Set Symbol = 'YHOO';")

' testing below

DA.SelectCommand = TestCmd

DS.AcceptChanges()

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 1335
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).rows(0).item(0) 'be aware that in this not strongly typed format
is object

I hope this gives an idea

Cor
"Scott" <sc***@scott.scott> 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.OleDbCommand("UPDATE CSV Set Symbol = 'YHOO';")

' testing below

DA.SelectCommand = TestCmd

DS.AcceptChanges()

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.Select 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.scott> 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****************@TK2MSFTNGP14.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).rows(0).item(0) 'be aware that in this not strongly typed
format is object

I hope this gives an idea

Cor
"Scott" <sc***@scott.scott> 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.OleDbCommand("UPDATE CSV Set Symbol = 'YHOO';")

' testing below

DA.SelectCommand = TestCmd

DS.AcceptChanges()

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
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...
8
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: ...
7
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...
2
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?...
0
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....
3
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...
5
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...
3
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,...
5
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...
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...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
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...
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: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
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.