Mark Rae said:
OK, let's back up a bit...
You mention Sql Stored procedures which leads me to think you are using
Microsoft SQL Server, but you are using OleDb... is that correct...? If
so, why are you not using the native .NET SQL Server data provider...?
Yes, sort of.
I am using Sql for most of my stuff. But in this case, I am reading in a
file from a .CSV file which happens to be a report. I then read this into a
DataSet. I then create about 5 reports all sorting and grouping to get the
different reports the client needs. I don't hit Sql at all here.
What I was saying about stored procedures was that in my other projects and
web pages this is how I always format my dates -
"Convert(varchar,getchar(),1)".
This is just a project I am working on currently that doesn't need Sql
Server but does need to do selects, sorts, grouping etc.
I was normally just taking the data from the report and writing it out to a
..csv file and had no problem there.
But this last report I need to create a fixed formatted line where the data
is just jammed next to each other. For example:
PR031507THIS IS A COMMENT 10850000000000000-1523
So I was using the - Convert(varchar,getchar(),1) - to get the date, and -
right("0000000000"+convert(varchar,amt),10) - to get the amount but left
fill with zeros and the length needs to be 10.
But if ADO.Net can't do this than I need to do it some other way. This
works fine in Sql Server.
Are you saying I can change it from OleDb.OleDbDataAdapter to SqlDb and that
would solve the problem?
I use the following connection strings:
Dim ConStr As String = _
"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & _
path & ";Extended Properties=""Text;HDR=No;FMT=Delimited\"""
Dim conn As New OleDb.OleDbConnection(ConStr)
Can I use the above with SqlClient to do the .csv reads?
Thanks,
Tom