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

How to: dBase as Datasource

datagrid1 has a single column contact

I'm getting an invalid datasource at...
Me.DataGrid1.DataSource = cmd

I don't want to use the methods here, I usually use SQLHelper
psuedo code: dim ds as new dataset = execute(.......

I just want to get my single colum populated.....

I'll work on more advanced stuff later....

'snipit...
Dim cmd As New OleDb.OleDbCommand
Dim cnn As OleDb.OleDbConnection
cnn = New
OleDb.OleDbConnection("Provider=Microsoft.Jet.OLED B.4.0;Data Source=" & _
"C:\Apps\R2M\Database;Extended Properties=DBASE
IV;")
cmd.CommandText = "select c1.* ,c2.* from c1 ,c2 where c1.accno
= c2.accno"
cmd.CommandType = CommandType.Text
cmd.Connection = cnn
cnn.Open()
'I chose this because it's there, perhaps another Excute Type
would be better.
cmd.ExecuteNonQuery()
cnn.Close()

'the following line casuses the noted error
Me.DataGrid1.DataSource = cmd
Me.DataGrid1.DataBind()

cnn.Dispose()
TIA

JeffP....
Jan 24 '06 #1
4 1733
I assume an ordinary access db will fail as well.
I say so since the connection is terminated
Make it a real connectionstring in web.config

"JeffP@Laptop" <No*********@sbcglobal.net> schreef in bericht
news:uZ**************@tk2msftngp13.phx.gbl...
datagrid1 has a single column contact

I'm getting an invalid datasource at...
Me.DataGrid1.DataSource = cmd

I don't want to use the methods here, I usually use SQLHelper
psuedo code: dim ds as new dataset = execute(.......

I just want to get my single colum populated.....

I'll work on more advanced stuff later....

'snipit...
Dim cmd As New OleDb.OleDbCommand
Dim cnn As OleDb.OleDbConnection
cnn = New
OleDb.OleDbConnection("Provider=Microsoft.Jet.OLED B.4.0;Data Source=" & _
"C:\Apps\R2M\Database;Extended Properties=DBASE
IV;")
cmd.CommandText = "select c1.* ,c2.* from c1 ,c2 where c1.accno
= c2.accno"
cmd.CommandType = CommandType.Text
cmd.Connection = cnn
cnn.Open()
'I chose this because it's there, perhaps another Excute Type
would be better.
cmd.ExecuteNonQuery()
cnn.Close()

'the following line casuses the noted error
Me.DataGrid1.DataSource = cmd
Me.DataGrid1.DataBind()

cnn.Dispose()
TIA

JeffP....

Jan 24 '06 #2
To be clear, a datagrid is an obsolete control in vs2005.
but that's not the point for now, i recommend the sqldatasource being placed
on the form and let it build a conn string for you.
The grid should be connected to the sqldatasource.. SO, NO CODE.

"Edwin Knoppert" <ne**@hellobasic.com> schreef in bericht
news:43***********************@text.nova.planet.nl ...
I assume an ordinary access db will fail as well.
I say so since the connection is terminated
Make it a real connectionstring in web.config

"JeffP@Laptop" <No*********@sbcglobal.net> schreef in bericht
news:uZ**************@tk2msftngp13.phx.gbl...
datagrid1 has a single column contact

I'm getting an invalid datasource at...
Me.DataGrid1.DataSource = cmd

I don't want to use the methods here, I usually use SQLHelper
psuedo code: dim ds as new dataset = execute(.......

I just want to get my single colum populated.....

I'll work on more advanced stuff later....

'snipit...
Dim cmd As New OleDb.OleDbCommand
Dim cnn As OleDb.OleDbConnection
cnn = New
OleDb.OleDbConnection("Provider=Microsoft.Jet.OLED B.4.0;Data Source=" & _
"C:\Apps\R2M\Database;Extended Properties=DBASE
IV;")
cmd.CommandText = "select c1.* ,c2.* from c1 ,c2 where
c1.accno = c2.accno"
cmd.CommandType = CommandType.Text
cmd.Connection = cnn
cnn.Open()
'I chose this because it's there, perhaps another Excute Type
would be better.
cmd.ExecuteNonQuery()
cnn.Close()

'the following line casuses the noted error
Me.DataGrid1.DataSource = cmd
Me.DataGrid1.DataBind()

cnn.Dispose()
TIA

JeffP....


Jan 24 '06 #3
JDP
Edwin, I'm very confused by your reply.

My datasource is comprised of files not an SQL database.

I will eventually place my conn string in the web.config as well as all of my
data access into a common.vb file similar to SQLHelper.

But for now I just want to connect to my database and read a single column,
"Hello World" style.

Perhaps this will help. my database files are dBase 4 or 6 files that reside in
the path;

C:\Apps\R2M\Database

Data file c1.dbf
Memo Blob file c1.dbt
Index file c1.mdx

This is not an MS Access database.

TIA

JeffP.....
"Edwin Knoppert" <ne**@hellobasic.com> wrote in message
news:43***********************@text.nova.planet.nl ...
To be clear, a datagrid is an obsolete control in vs2005.
but that's not the point for now, i recommend the sqldatasource being placed
on the form and let it build a conn string for you.
The grid should be connected to the sqldatasource.. SO, NO CODE.

"Edwin Knoppert" <ne**@hellobasic.com> schreef in bericht
news:43***********************@text.nova.planet.nl ...
I assume an ordinary access db will fail as well.
I say so since the connection is terminated
Make it a real connectionstring in web.config

"JeffP@Laptop" <No*********@sbcglobal.net> schreef in bericht
news:uZ**************@tk2msftngp13.phx.gbl...
datagrid1 has a single column contact

I'm getting an invalid datasource at...
Me.DataGrid1.DataSource = cmd

I don't want to use the methods here, I usually use SQLHelper
psuedo code: dim ds as new dataset = execute(.......

I just want to get my single colum populated.....

I'll work on more advanced stuff later....

'snipit...
Dim cmd As New OleDb.OleDbCommand
Dim cnn As OleDb.OleDbConnection
cnn = New
OleDb.OleDbConnection("Provider=Microsoft.Jet.OLED B.4.0;Data Source=" & _
"C:\Apps\R2M\Database;Extended Properties=DBASE
IV;")
cmd.CommandText = "select c1.* ,c2.* from c1 ,c2 where
c1.accno = c2.accno"
cmd.CommandType = CommandType.Text
cmd.Connection = cnn
cnn.Open()
'I chose this because it's there, perhaps another Excute Type
would be better.
cmd.ExecuteNonQuery()
cnn.Close()

'the following line casuses the noted error
Me.DataGrid1.DataSource = cmd
Me.DataGrid1.DataBind()

cnn.Dispose()
TIA

JeffP....



Jan 24 '06 #4
If you want i can write a VS2005 (!) example with the gridview?

I'm sure it works but i have to test.
Do NOT try to write a connectionstring manually, the sqlsdatasource cn do
that for you.
My collegue is also not use to that, let the designer help you, not code
involved.

Give me a call if you need a dbf example.
Would be nice if i had your dbf to use.

sqldatasource is NOT directly related to sqlserver.
A wrong name imo.
Forget the access datasource, this is a wweird breed imo.
Evt. mail.
"JDP@Work" <JP*********@sbcglobal.net> schreef in bericht
news:eq**************@tk2msftngp13.phx.gbl...
Edwin, I'm very confused by your reply.

My datasource is comprised of files not an SQL database.

I will eventually place my conn string in the web.config as well as all of
my
data access into a common.vb file similar to SQLHelper.

But for now I just want to connect to my database and read a single
column,
"Hello World" style.

Perhaps this will help. my database files are dBase 4 or 6 files that
reside in
the path;

C:\Apps\R2M\Database

Data file c1.dbf
Memo Blob file c1.dbt
Index file c1.mdx

This is not an MS Access database.

TIA

JeffP.....
"Edwin Knoppert" <ne**@hellobasic.com> wrote in message
news:43***********************@text.nova.planet.nl ...
To be clear, a datagrid is an obsolete control in vs2005.
but that's not the point for now, i recommend the sqldatasource being
placed
on the form and let it build a conn string for you.
The grid should be connected to the sqldatasource.. SO, NO CODE.

"Edwin Knoppert" <ne**@hellobasic.com> schreef in bericht
news:43***********************@text.nova.planet.nl ...
>I assume an ordinary access db will fail as well.
> I say so since the connection is terminated
> Make it a real connectionstring in web.config
>
>
>
> "JeffP@Laptop" <No*********@sbcglobal.net> schreef in bericht
> news:uZ**************@tk2msftngp13.phx.gbl...
>> datagrid1 has a single column contact
>>
>> I'm getting an invalid datasource at...
>> Me.DataGrid1.DataSource = cmd
>>
>> I don't want to use the methods here, I usually use SQLHelper
>> psuedo code: dim ds as new dataset = execute(.......
>>
>> I just want to get my single colum populated.....
>>
>> I'll work on more advanced stuff later....
>>
>> 'snipit...
>> Dim cmd As New OleDb.OleDbCommand
>> Dim cnn As OleDb.OleDbConnection
>> cnn = New
>> OleDb.OleDbConnection("Provider=Microsoft.Jet.OLED B.4.0;Data Source="
>> & _
>> "C:\Apps\R2M\Database;Extended Properties=DBASE
>> IV;")
>> cmd.CommandText = "select c1.* ,c2.* from c1 ,c2 where
>> c1.accno = c2.accno"
>> cmd.CommandType = CommandType.Text
>> cmd.Connection = cnn
>> cnn.Open()
>> 'I chose this because it's there, perhaps another Excute
>> Type
>> would be better.
>> cmd.ExecuteNonQuery()
>> cnn.Close()
>>
>> 'the following line casuses the noted error
>> Me.DataGrid1.DataSource = cmd
>> Me.DataGrid1.DataBind()
>>
>> cnn.Dispose()
>> TIA
>>
>> JeffP....
>>
>
>



Jan 24 '06 #5

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

Similar topics

4
by: Matt Young | last post by:
I've been tasked with integrating an older management system based on DBF files with my snappy new ASP application to provide users of the ASP application with real-time data from the management...
2
by: Ivan | last post by:
Hi, SQL Server 2000 SP3 Windos 2000 Server SP4 I have a DTS package that imports data from a dBase IV databse with files located in two folders (dBF1 and dBF2). I use a transform data task...
6
by: Maurice Mertens | last post by:
Hi, how can I open and read a DbaseIII file in .NET? -- Met vriendelijke groet / With regards / Saludos, Moviat Automatisering
3
by: Chumley the Walrus | last post by:
IN my code behind .vb page for a delete records script (this also does a deletion confirmation with a javascript popup, this gets called on my front .aspx page with the datagrid), I'm not sure if...
5
by: yvan | last post by:
Approximately once a month, a client of ours sends us a bunch of comma-delimited text files which I have to clean up and then import into their MS SQL database. All last week, I was using a Cold...
1
by: Derek Griffiths | last post by:
Most of the complicated programs I write are boring applications that manipulate databases associated with the medical billing program where I work. The program uses foxpro dbases (version 3) for...
1
by: Durumdara | last post by:
Hi ! I have a text processor code and I want to put the results to standard files. HTML, XML, SQLite - they are ok. But I want to put these datas to DBF too, because when records are many,...
2
by: Songyang | last post by:
I'm new to this group. In my company in Japan, we have been using dbase for almost 20 years, and we are now switching to foxpro. Dose anybody here has experience in converting dbase programs from...
2
by: bcbrock | last post by:
I am trying to figure out how to query some data out of a dbase IV (.dbf) file sitting on a remote server from my MySQL/PHP/Web Server. Both servers are Windows Server 2003 SP2. My...
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...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
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
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
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
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.