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

Write to an Access database

I have code that reads and parses a text file using a schema.ini file. Works
great. When I see the dataGrid it's exactly what I want.

Dim CString As String = _
"Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=C:\;" & _
"Extended Properties=""text;HDR=No;"""

Dim TConnect As New System.Data.OleDb.OleDbConnection(CString)

TConnect.Open()

Dim da As New System.Data.OleDb.OleDbDataAdapter("Select * from
837P.txt", TConnect)

Dim ds As New DataSet("Bananas")

da.Fill(ds)
DataGridView1.DataSource = ds.Tables(0)

I now want to take this table from the dataGridVew and write it out to my
Access database.

I have code to connect to the db. I can run delete queries against it but I
can't figure out how to add this data to it. I've been all over the internet
and I get close but no joy.

Here's the code I have for the Access half:

Dim objConnection As New OleDbConnection(accessConnect)
'Dim strSQL As String = "Select * INTO z FROM " & table & ";"
Dim strSQL As String = "DELETE text_table.* FROM text_table;"
Dim objCommand As New OleDbCommand(strSQL, objConnection)
Dim objDataAdapter As New OleDbDataAdapter(objCommand)
Dim objDataTable As New Data.DataTable("text_table")
Dim objDataRow As DataRow
Dim intRowsAffected As Integer

Try
'open db connection
objConnection.Open()
intRowsAffected = objCommand.ExecuteNonQuery()

Catch oledbexceptionerr As Exception
MessageBox.Show(oledbexceptionerr.Message)
End Try

objConnection.Close()

Is there a way to just tweak this code to get it to write my table to
"text_table" in my db?
May 4 '07 #1
12 2071
Jim
To clarify: what I think I need is a way to construct the SQL to
reference the ds.tables(0) below is something like "SELECT * INTO
text_table FROM dsTable" Where Dim dsTable dataTable = ds.tables(0),
but I can't get that to work.

I saw on one helpful post that an SQL to update the db was all that's
needed. HA!

Jim

P.S. I've seen the question asked in other posts but I've never seen a
direct answer. Please don't send me off to a reference on the topic.
That's what I've been looking at for the last 8 hours and still can't
get it. Maybe its just me and its too late and I'm too tired. :-( oh
oh... self pity is starting to creep in. I'm out of here.

Jim wrote:
I have code that reads and parses a text file using a schema.ini file. Works
great. When I see the dataGrid it's exactly what I want.

Dim CString As String = _
"Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=C:\;" & _
"Extended Properties=""text;HDR=No;"""

Dim TConnect As New System.Data.OleDb.OleDbConnection(CString)

TConnect.Open()

Dim da As New System.Data.OleDb.OleDbDataAdapter("Select * from
837P.txt", TConnect)

Dim ds As New DataSet("Bananas")

da.Fill(ds)
DataGridView1.DataSource = ds.Tables(0)

I now want to take this table from the dataGridVew and write it out to my
Access database.

I have code to connect to the db. I can run delete queries against it but I
can't figure out how to add this data to it. I've been all over the internet
and I get close but no joy.

Here's the code I have for the Access half:
Dim dsTable dataTable = ds.tables(0)

Dim objConnection As New OleDbConnection(accessConnect)
'Dim strSQL As String = "Select * INTO z FROM " & table & ";"
Dim strSQL As String = "DELETE text_table.* FROM text_table;"
Dim objCommand As New OleDbCommand(strSQL, objConnection)
Dim objDataAdapter As New OleDbDataAdapter(objCommand)
Dim objDataTable As New Data.DataTable("text_table")
Dim objDataRow As DataRow
Dim intRowsAffected As Integer

Try
'open db connection
objConnection.Open()
intRowsAffected = objCommand.ExecuteNonQuery()

Catch oledbexceptionerr As Exception
MessageBox.Show(oledbexceptionerr.Message)
End Try

objConnection.Close()

Is there a way to just tweak this code to get it to write my table to
"text_table" in my db?

May 4 '07 #2
Jim,

In Net you are mostly working with binded controls. The DataGridView is a
complex databinded control.

You can work with strongly typed datasets (datatable) and with non strongly
typed ones, let say basic ones.

In the area of the strongly typed datasets we see every time much more
progress. As example in the time of Net 1.x everybody was talking here only
about non strongly typed ones, now it becomes more and more strongly typed
ones.

However nothing wrong how you did it, however you have now to build your own
Update, Insert and Delete SQL statemements.

But you can also use the OleDBCommandbuilder a command wich is disliked by
many people however is in my idea perfect as long as that your updates are
as simple that they come in fact from a grid.

http://msdn2.microsoft.com/en-us/lib...ndbuilder.aspx

I hope this helps,

Cor

"Jim" <Ji*@discussions.microsoft.comschreef in bericht
news:55**********************************@microsof t.com...
>I have code that reads and parses a text file using a schema.ini file.
Works
great. When I see the dataGrid it's exactly what I want.

Dim CString As String = _
"Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=C:\;" & _
"Extended Properties=""text;HDR=No;"""

Dim TConnect As New System.Data.OleDb.OleDbConnection(CString)

TConnect.Open()

Dim da As New System.Data.OleDb.OleDbDataAdapter("Select * from
837P.txt", TConnect)

Dim ds As New DataSet("Bananas")

da.Fill(ds)
DataGridView1.DataSource = ds.Tables(0)

I now want to take this table from the dataGridVew and write it out to my
Access database.

I have code to connect to the db. I can run delete queries against it but
I
can't figure out how to add this data to it. I've been all over the
internet
and I get close but no joy.

Here's the code I have for the Access half:

Dim objConnection As New OleDbConnection(accessConnect)
'Dim strSQL As String = "Select * INTO z FROM " & table & ";"
Dim strSQL As String = "DELETE text_table.* FROM text_table;"
Dim objCommand As New OleDbCommand(strSQL, objConnection)
Dim objDataAdapter As New OleDbDataAdapter(objCommand)
Dim objDataTable As New Data.DataTable("text_table")
Dim objDataRow As DataRow
Dim intRowsAffected As Integer

Try
'open db connection
objConnection.Open()
intRowsAffected = objCommand.ExecuteNonQuery()

Catch oledbexceptionerr As Exception
MessageBox.Show(oledbexceptionerr.Message)
End Try

objConnection.Close()

Is there a way to just tweak this code to get it to write my table to
"text_table" in my db?


May 4 '07 #3
Jim
Cor,

Thanks for the insight. I've looked at your reference and I'm still
somewhat confused. I'm a newbie in .net. I've read other posts where
it was said "just build the SQL statements". I can't see how to do that
nor can I see how the OleDBCommandbuilder will help do that. I know I'm
missing something simple here.

Can someone give me a short example of what that SQL statement might
look like based on my code below?

Jim

Cor Ligthert [MVP] wrote:
Jim,

In Net you are mostly working with binded controls. The DataGridView is a
complex databinded control.

You can work with strongly typed datasets (datatable) and with non strongly
typed ones, let say basic ones.

In the area of the strongly typed datasets we see every time much more
progress. As example in the time of Net 1.x everybody was talking here only
about non strongly typed ones, now it becomes more and more strongly typed
ones.

However nothing wrong how you did it, however you have now to build your own
Update, Insert and Delete SQL statemements.

But you can also use the OleDBCommandbuilder a command wich is disliked by
many people however is in my idea perfect as long as that your updates are
as simple that they come in fact from a grid.

http://msdn2.microsoft.com/en-us/lib...ndbuilder.aspx

I hope this helps,

Cor

"Jim" <Ji*@discussions.microsoft.comschreef in bericht
news:55**********************************@microsof t.com...
>I have code that reads and parses a text file using a schema.ini file.
Works
great. When I see the dataGrid it's exactly what I want.

Dim CString As String = _
"Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=C:\;" & _
"Extended Properties=""text;HDR=No;"""

Dim TConnect As New System.Data.OleDb.OleDbConnection(CString)

TConnect.Open()

Dim da As New System.Data.OleDb.OleDbDataAdapter("Select * from
837P.txt", TConnect)

Dim ds As New DataSet("Bananas")

da.Fill(ds)
DataGridView1.DataSource = ds.Tables(0)

I now want to take this table from the dataGridVew and write it out to my
Access database.

I have code to connect to the db. I can run delete queries against it but
I
can't figure out how to add this data to it. I've been all over the
internet
and I get close but no joy.

Here's the code I have for the Access half:

Dim objConnection As New OleDbConnection(accessConnect)
'Dim strSQL As String = "Select * INTO z FROM " & table & ";"
Dim strSQL As String = "DELETE text_table.* FROM text_table;"
Dim objCommand As New OleDbCommand(strSQL, objConnection)
Dim objDataAdapter As New OleDbDataAdapter(objCommand)
Dim objDataTable As New Data.DataTable("text_table")
Dim objDataRow As DataRow
Dim intRowsAffected As Integer

Try
'open db connection
objConnection.Open()
intRowsAffected = objCommand.ExecuteNonQuery()

Catch oledbexceptionerr As Exception
MessageBox.Show(oledbexceptionerr.Message)
End Try

objConnection.Close()

Is there a way to just tweak this code to get it to write my table to
"text_table" in my db?


May 4 '07 #4
CORRECTION!

Jet shouldn't be used by anyone for any reason

SERIOUS KID
move to SQL Server
On May 3, 5:07 pm, Jim <J...@discussions.microsoft.comwrote:
I have code that reads and parses a text file using a schema.ini file. Works
great. When I see the dataGrid it's exactly what I want.

Dim CString As String = _
"Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=C:\;" & _
"Extended Properties=""text;HDR=No;"""

Dim TConnect As New System.Data.OleDb.OleDbConnection(CString)

TConnect.Open()

Dim da As New System.Data.OleDb.OleDbDataAdapter("Select * from
837P.txt", TConnect)

Dim ds As New DataSet("Bananas")

da.Fill(ds)
DataGridView1.DataSource = ds.Tables(0)

I now want to take this table from the dataGridVew and write it out to my
Access database.

I have code to connect to the db. I can run delete queries against it but I
can't figure out how to add this data to it. I've been all over the internet
and I get close but no joy.

Here's the code I have for the Access half:

Dim objConnection As New OleDbConnection(accessConnect)
'Dim strSQL As String = "Select * INTO z FROM " & table & ";"
Dim strSQL As String = "DELETE text_table.* FROM text_table;"
Dim objCommand As New OleDbCommand(strSQL, objConnection)
Dim objDataAdapter As New OleDbDataAdapter(objCommand)
Dim objDataTable As New Data.DataTable("text_table")
Dim objDataRow As DataRow
Dim intRowsAffected As Integer

Try
'open db connection
objConnection.Open()
intRowsAffected = objCommand.ExecuteNonQuery()

Catch oledbexceptionerr As Exception
MessageBox.Show(oledbexceptionerr.Message)
End Try

objConnection.Close()

Is there a way to just tweak this code to get it to write my table to
"text_table" in my db?

May 4 '07 #5
select from where

or insert select
or insert values

or delete from table where

or update table set


On May 4, 6:22 am, Jim <joSmith...@RemoveThisStuffNetscape.netwrote:
Cor,

Thanks for the insight. I've looked at your reference and I'm still
somewhat confused. I'm a newbie in .net. I've read other posts where
it was said "just build the SQL statements". I can't see how to do that
nor can I see how the OleDBCommandbuilder will help do that. I know I'm
missing something simple here.

Can someone give me a short example of what that SQL statement might
look like based on my code below?

Jim

Cor Ligthert [MVP] wrote:
Jim,
In Net you are mostly working with binded controls. The DataGridView is a
complex databinded control.
You can work with strongly typed datasets (datatable) and with non strongly
typed ones, let say basic ones.
In the area of the strongly typed datasets we see every time much more
progress. As example in the time of Net 1.x everybody was talking here only
about non strongly typed ones, now it becomes more and more strongly typed
ones.
However nothing wrong how you did it, however you have now to build your own
Update, Insert and Delete SQL statemements.
But you can also use the OleDBCommandbuilder a command wich is disliked by
many people however is in my idea perfect as long as that your updates are
as simple that they come in fact from a grid.
http://msdn2.microsoft.com/en-us/lib...edb.oledbcomma...
I hope this helps,
Cor
"Jim" <J...@discussions.microsoft.comschreef in bericht
news:55**********************************@microsof t.com...
I have code that reads and parses a text file using a schema.ini file.
Works
great. When I see the dataGrid it's exactly what I want.
Dim CString As String = _
"Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=C:\;" & _
"Extended Properties=""text;HDR=No;"""
Dim TConnect As New System.Data.OleDb.OleDbConnection(CString)
TConnect.Open()
Dim da As New System.Data.OleDb.OleDbDataAdapter("Select * from
837P.txt", TConnect)
Dim ds As New DataSet("Bananas")
da.Fill(ds)
DataGridView1.DataSource = ds.Tables(0)
I now want to take this table from the dataGridVew and write it out to my
Access database.
I have code to connect to the db. I can run delete queries against it but
I
can't figure out how to add this data to it. I've been all over the
internet
and I get close but no joy.
Here's the code I have for the Access half:
Dim objConnection As New OleDbConnection(accessConnect)
'Dim strSQL As String = "Select * INTO z FROM " & table & ";"
Dim strSQL As String = "DELETE text_table.* FROM text_table;"
Dim objCommand As New OleDbCommand(strSQL, objConnection)
Dim objDataAdapter As New OleDbDataAdapter(objCommand)
Dim objDataTable As New Data.DataTable("text_table")
Dim objDataRow As DataRow
Dim intRowsAffected As Integer
Try
'open db connection
objConnection.Open()
intRowsAffected = objCommand.ExecuteNonQuery()
Catch oledbexceptionerr As Exception
MessageBox.Show(oledbexceptionerr.Message)
End Try
objConnection.Close()
Is there a way to just tweak this code to get it to write my table to
"text_table" in my db?- Hide quoted text -

- Show quoted text -

May 4 '07 #6
Jim
That I could do. The problem is I'm working from:
>>> Dim ds As New DataSet("Bananas")
da.Fill(ds)
DataGridView1.DataSource = ds.Tables(0)
See below for details. I can't figuer out how to reference the table.

db*******@hotmail.com wrote:
select from where

or insert select
or insert values

or delete from table where

or update table set


On May 4, 6:22 am, Jim <joSmith...@RemoveThisStuffNetscape.netwrote:
>Cor,

Thanks for the insight. I've looked at your reference and I'm still
somewhat confused. I'm a newbie in .net. I've read other posts where
it was said "just build the SQL statements". I can't see how to do that
nor can I see how the OleDBCommandbuilder will help do that. I know I'm
missing something simple here.

Can someone give me a short example of what that SQL statement might
look like based on my code below?

Jim

Cor Ligthert [MVP] wrote:
>>Jim,
In Net you are mostly working with binded controls. The DataGridView is a
complex databinded control.
You can work with strongly typed datasets (datatable) and with non strongly
typed ones, let say basic ones.
In the area of the strongly typed datasets we see every time much more
progress. As example in the time of Net 1.x everybody was talking here only
about non strongly typed ones, now it becomes more and more strongly typed
ones.
However nothing wrong how you did it, however you have now to build your own
Update, Insert and Delete SQL statemements.
But you can also use the OleDBCommandbuilder a command wich is disliked by
many people however is in my idea perfect as long as that your updates are
as simple that they come in fact from a grid.
http://msdn2.microsoft.com/en-us/lib...edb.oledbcomma...
I hope this helps,
Cor
"Jim" <J...@discussions.microsoft.comschreef in bericht
news:55**********************************@micros oft.com...
I have code that reads and parses a text file using a schema.ini file.
Works
great. When I see the dataGrid it's exactly what I want.
Dim CString As String = _
>>> "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=C:\;" & _
"Extended Properties=""text;HDR=No;"""
Dim TConnect As New System.Data.OleDb.OleDbConnection(CString)
TConnect.Open()
Dim da As New System.Data.OleDb.OleDbDataAdapter("Select * from
837P.txt", TConnect)
Dim ds As New DataSet("Bananas")
da.Fill(ds)
DataGridView1.DataSource = ds.Tables(0)
I now want to take this table from the dataGridVew and write it out to my
Access database.
I have code to connect to the db. I can run delete queries against it but
I
can't figure out how to add this data to it. I've been all over the
internet
and I get close but no joy.
Here's the code I have for the Access half:
Dim objConnection As New OleDbConnection(accessConnect)
'Dim strSQL As String = "Select * INTO z FROM " & table & ";"
Dim strSQL As String = "DELETE text_table.* FROM text_table;"
Dim objCommand As New OleDbCommand(strSQL, objConnection)
Dim objDataAdapter As New OleDbDataAdapter(objCommand)
Dim objDataTable As New Data.DataTable("text_table")
Dim objDataRow As DataRow
Dim intRowsAffected As Integer
Try
'open db connection
objConnection.Open()
intRowsAffected = objCommand.ExecuteNonQuery()
Catch oledbexceptionerr As Exception
MessageBox.Show(oledbexceptionerr.Message)
End Try
objConnection.Close()
Is there a way to just tweak this code to get it to write my table to
"text_table" in my db?- Hide quoted text -
- Show quoted text -

May 4 '07 #7
you don't need an INTO statement if you're just referencing a sql
statement in ADO.net

an INTO statement will run a 'make table query'
hth

On May 4, 3:33 pm, Jim <joSmith...@RemoveThisStuffNetscape.netwrote:
That I could do. The problem is I'm working from:
>>> Dim ds As New DataSet("Bananas")
>>> da.Fill(ds)
>>> DataGridView1.DataSource = ds.Tables(0)

See below for details. I can't figuer out how to reference the table.

dbahoo...@hotmail.com wrote:
select from where
or insert select
or insert values
or delete from table where
or update table set
On May 4, 6:22 am, Jim <joSmith...@RemoveThisStuffNetscape.netwrote:
Cor,
Thanks for the insight. I've looked at your reference and I'm still
somewhat confused. I'm a newbie in .net. I've read other posts where
it was said "just build the SQL statements". I can't see how to do that
nor can I see how the OleDBCommandbuilder will help do that. I know I'm
missing something simple here.
Can someone give me a short example of what that SQL statement might
look like based on my code below?
Jim
Cor Ligthert [MVP] wrote:
Jim,
In Net you are mostly working with binded controls. The DataGridView is a
complex databinded control.
You can work with strongly typed datasets (datatable) and with non strongly
typed ones, let say basic ones.
In the area of the strongly typed datasets we see every time much more
progress. As example in the time of Net 1.x everybody was talking here only
about non strongly typed ones, now it becomes more and more strongly typed
ones.
However nothing wrong how you did it, however you have now to build your own
Update, Insert and Delete SQL statemements.
But you can also use the OleDBCommandbuilder a command wich is disliked by
many people however is in my idea perfect as long as that your updates are
as simple that they come in fact from a grid.
http://msdn2.microsoft.com/en-us/lib...edb.oledbcomma...
I hope this helps,
Cor
"Jim" <J...@discussions.microsoft.comschreef in bericht
news:55**********************************@micros oft.com...
I have code that reads and parses a text file using a schema.ini file.
Works
great. When I see the dataGrid it's exactly what I want.
Dim CString As String = _
>> "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=C:\;" & _
"Extended Properties=""text;HDR=No;"""
Dim TConnect As New System.Data.OleDb.OleDbConnection(CString)
TConnect.Open()
Dim da As New System.Data.OleDb.OleDbDataAdapter("Select * from
837P.txt", TConnect)
Dim ds As New DataSet("Bananas")
da.Fill(ds)
DataGridView1.DataSource = ds.Tables(0)
I now want to take this table from the dataGridVew and write it out to my
Access database.
I have code to connect to the db. I can run delete queries against it but
I
can't figure out how to add this data to it. I've been all over the
internet
and I get close but no joy.
Here's the code I have for the Access half:
Dim objConnection As New OleDbConnection(accessConnect)
'Dim strSQL As String = "Select * INTO z FROM " & table & ";"
Dim strSQL As String = "DELETE text_table.* FROM text_table;"
Dim objCommand As New OleDbCommand(strSQL, objConnection)
Dim objDataAdapter As New OleDbDataAdapter(objCommand)
Dim objDataTable As New Data.DataTable("text_table")
Dim objDataRow As DataRow
Dim intRowsAffected As Integer
Try
'open db connection
objConnection.Open()
intRowsAffected = objCommand.ExecuteNonQuery()
Catch oledbexceptionerr As Exception
MessageBox.Show(oledbexceptionerr.Message)
End Try
objConnection.Close()
Is there a way to just tweak this code to get it to write my table to
"text_table" in my db?- Hide quoted text -
- Show quoted text -- Hide quoted text -

- Show quoted text -

May 7 '07 #8
Jim
OK so what DO I need?

Coming from here:

<snip==== This Works Fine ====
Dim CString As String = _
"Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=C:\;" & _
"Extended Properties=""text;HDR=No;"""
Dim TConnect As New System.Data.OleDb.OleDbConnection(CString)
TConnect.Open()
Dim da As New System.Data.OleDb.OleDbDataAdapter("Select * from
837P.txt", TConnect)
Dim ds As New DataSet("Bananas")
da.Fill(ds)
DataGridView1.DataSource = ds.Tables(0)
<snip>

How do I get that ds.tables(0) into a table here?
Dim AString As String = _
"Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=C:\abc.mdb;"
Sorry I'm the newbie. I just can't see how to that dataset(Bananas).

db*******@hotmail.com wrote:
you don't need an INTO statement if you're just referencing a sql
statement in ADO.net

an INTO statement will run a 'make table query'
hth
May 7 '07 #9
you just need to fire a SQL Statemnet

Dim strSql as string
strSql = "BULK INSERT TblName FROM 'C:\MyPath.txt'

You can lookup more about it in SQL Server books online


On May 7, 4:49 pm, Jim <joSmith...@RemoveThisStuffNetscape.netwrote:
OK so what DO I need?

Coming from here:

<snip==== This Works Fine ====
Dim CString As String = _
"Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=C:\;" & _
"Extended Properties=""text;HDR=No;"""
Dim TConnect As New System.Data.OleDb.OleDbConnection(CString)
TConnect.Open()
Dim da As New System.Data.OleDb.OleDbDataAdapter("Select * from
837P.txt", TConnect)
Dim ds As New DataSet("Bananas")
da.Fill(ds)
DataGridView1.DataSource = ds.Tables(0)
<snip>

How do I get that ds.tables(0) into a table here?
Dim AString As String = _
"Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=C:\abc.mdb;"

Sorry I'm the newbie. I just can't see how to that dataset(Bananas).

dbahoo...@hotmail.com wrote:
you don't need an INTO statement if you're just referencing a sql
statement in ADO.net
an INTO statement will run a 'make table query'
hth- Hide quoted text -

- Show quoted text -

May 16 '07 #10
and about the whole data adapter thing; I don't believe in ADO.net--
It doesnt' allow you to share a connection (two recordsets on the same
connection) and it doesn't allow you to keep a connection open.

To me? That's a worthless Data Access Library.
I'd rather use DAO or ADO Classic


On May 7, 4:49 pm, Jim <joSmith...@RemoveThisStuffNetscape.netwrote:
OK so what DO I need?

Coming from here:

<snip==== This Works Fine ====
Dim CString As String = _
"Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=C:\;" & _
"Extended Properties=""text;HDR=No;"""
Dim TConnect As New System.Data.OleDb.OleDbConnection(CString)
TConnect.Open()
Dim da As New System.Data.OleDb.OleDbDataAdapter("Select * from
837P.txt", TConnect)
Dim ds As New DataSet("Bananas")
da.Fill(ds)
DataGridView1.DataSource = ds.Tables(0)
<snip>

How do I get that ds.tables(0) into a table here?
Dim AString As String = _
"Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=C:\abc.mdb;"

Sorry I'm the newbie. I just can't see how to that dataset(Bananas).

dbahoo...@hotmail.com wrote:
you don't need an INTO statement if you're just referencing a sql
statement in ADO.net
an INTO statement will run a 'make table query'
hth- Hide quoted text -

- Show quoted text -

May 16 '07 #11
Try posting your question to microsoft.public.dotnet.framework.adonet.

And watch out for advice from dbahooker; he is a known troll in this
newsgroup.

Robin S.
=======================
"Jim" <jo********@RemoveThisStuffNetscape.netwrote in message
news:wY******************************@massilloncab letv.com...
OK so what DO I need?

Coming from here:

<snip==== This Works Fine ====
Dim CString As String = _
"Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=C:\;" & _
"Extended Properties=""text;HDR=No;"""
Dim TConnect As New System.Data.OleDb.OleDbConnection(CString)
TConnect.Open()
Dim da As New System.Data.OleDb.OleDbDataAdapter("Select * from
837P.txt", TConnect)
Dim ds As New DataSet("Bananas")
da.Fill(ds)
DataGridView1.DataSource = ds.Tables(0)
<snip>

How do I get that ds.tables(0) into a table here?
Dim AString As String = _
"Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=C:\abc.mdb;"
Sorry I'm the newbie. I just can't see how to that dataset(Bananas).

db*******@hotmail.com wrote:
>you don't need an INTO statement if you're just referencing a sql
statement in ADO.net

an INTO statement will run a 'make table query'
hth

May 20 '07 #12
ROFL

a known troll.. like it is a bad thign

I stand up for freedom of speech and freedom from buggy software
I stand up for a consistent marketing message

and I stand up for VB

everyone else around here is a big fat lazy wuss.. oh are the widdle
baby programmers AFWAID OF DEMANDING EXCELLENCE?

On May 20, 10:36 am, "RobinS" <Rob...@NoSpam.yah.nonewrote:
Try posting your question to microsoft.public.dotnet.framework.adonet.

And watch out for advice from dbahooker; he is a known troll in this
newsgroup.

Robin S.
======================="Jim" <joSmith...@RemoveThisStuffNetscape.netwrote in message

news:wY******************************@massilloncab letv.com...
OK so what DO I need?
Coming from here:
<snip==== This Works Fine ====
Dim CString As String = _
"Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=C:\;" & _
"Extended Properties=""text;HDR=No;"""
Dim TConnect As New System.Data.OleDb.OleDbConnection(CString)
TConnect.Open()
Dim da As New System.Data.OleDb.OleDbDataAdapter("Select * from
837P.txt", TConnect)
Dim ds As New DataSet("Bananas")
da.Fill(ds)
DataGridView1.DataSource = ds.Tables(0)
<snip>
How do I get that ds.tables(0) into a table here?
Dim AString As String = _
"Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=C:\abc.mdb;"
Sorry I'm the newbie. I just can't see how to that dataset(Bananas).
dbahoo...@hotmail.com wrote:
you don't need an INTO statement if you're just referencing a sql
statement in ADO.net
an INTO statement will run a 'make table query'
hth- Hide quoted text -

- Show quoted text -

May 21 '07 #13

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

Similar topics

5
by: Norman Fritag | last post by:
Hi there, The Problem: I can't write data to an access database in a webfolder of a windows Prof 2000 machine, whereas the same web application runs fine under Windows XP. I looked into the...
6
by: Clément Collin | last post by:
I working on a GIS project, with Access link which just need a little routine in VBA, but I haven't knowledges in VBA language. It's very simple, and it looks like that in a TPascal way : .......
6
by: Eric J. | last post by:
I am having a problem writing to an Access database. It only seems to work if the database is placed in c:\ Retrieving records from it is no problem when it is placed in a subdirectory of mapppath,...
6
by: sambuela | last post by:
How can I write message to the file located in the wwwroot directory? It seems that IIS protect these files. Let make me cannot do the I/O writing sucessfully. I try to open file's write...
1
by: hulinning | last post by:
Hi I use webservice to read/write data to Access database using System.Data.OleDb with a connection string = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source;User Id=admin;Password=" I can...
4
by: crystal | last post by:
I've checked the threads but haven't been able to come up with a solution to my issue. Help...... I have a simple form based on a table. Within the form is a subform that is also, through a Q,...
2
by: Alan T | last post by:
<?xml version="1.0" encoding="utf-8" ?> <configuration> <connectionStrings> <add name="DataBaseConnection" connectionString="server=localhost;database=SalesDB;User
0
by: Ed Sutton | last post by:
Is there a FileSecurity method that can determine if the current WindowsIdentity has write access to a file? I can get the current windows identity and use FileSecurity to return the ...
0
by: musosmiffy | last post by:
Hi, I have been trying to get the following working for days - I wonder if anyone could help me? I am trying to list a set of database entries as a newspaper column. I am using classic ASP (not...
3
by: sriram347 | last post by:
Hi I am a newbie to ASP.NET. I developed a web page (project type is web application) and I keep getting this error. B]Error message : "System.AccessViolation Exception attempted to read or...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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
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
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...

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.