By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,851 Members | 1,022 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,851 IT Pros & Developers. It's quick & easy.

Scanning a file?

P: n/a
I have a form with a button called btnScan. When i click on this button
i want to scan a file and save it in the database. Any hints?? ideas???
solutions???

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 16 '05 #1
Share this Question
Share on Google+
8 Replies


P: n/a
what is scanning here? do you need to get some data out of the file. if so
you can open the file and do it the normal way.

Av.
"Marie-Christine Bechara" <ma*********************@ifsal.com> wrote in
message news:eJ**************@tk2msftngp13.phx.gbl...
I have a form with a button called btnScan. When i click on this button
i want to scan a file and save it in the database. Any hints?? ideas???
solutions???

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Nov 16 '05 #2

P: n/a
Marie-Christine Bechara wrote:
I have a form with a button called btnScan. When i click on this button
i want to scan a file and save it in the database. Any hints?? ideas???
solutions???

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!Hi,


Hi,

What I did was the following:
(Inside the Eventhandler for the button click!)

Open the file - Parse the lines - Close the File - Generate SQL
statement - Execute the statement
Example:

MySQLString sql = new MySQLString();
StreamReader sr = new
StreamReader(tmp.DIOFile,System.Text.Encoding.Defa ult);

string actLine;

while( (actLine = sr.ReadLine()) != null )
{
#region Process the Data Here
sql.SQLCommand = "INSERT INTO DBTBL.name VALUES ('"+actLine+"')";
#endregion
}

sr.Close();

#region PROCESS ODBC STUFF HERE
if(ODBCConnection.State != ConnectionState.Open)
ODBCConnection.Open();

OdbcCommand comm = new OdbcCommand(sql.SQLCommand, ODBCConnection);

try
{
comm.ExecuteNonQuery();
comm.Dispose();
}
catch(OdbcException ex)
{
MessageBox.Show(ex.Errors[0].Message);
ODBCConnection.Close();
return;
}

ODBCConnection.Close();

#endregion
Hope this is what you are looking for,

Martin
Nov 16 '05 #3

P: n/a
I mean by scanning the actual scanning of a document using the Scanner.
When i click on the Scan button, i need some kind of functionality that
allows me to scan.

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 16 '05 #4

P: n/a
Marie-Christine Bechara wrote:
I mean by scanning the actual scanning of a document using the Scanner.
When i click on the Scan button, i need some kind of functionality that
allows me to scan.

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Sorry,

no experience with this one!

Martin
Nov 16 '05 #5

P: n/a
Hi Marie ..

Working with the scanner can be tricky, I have no much experience in that
field so I will just give you hints of what to search, no the solution
itself, the scanners IIRC use a protocol named TWAIN to comunicate, if you
do a search for TWAIN and scanner in google groups :
http://groups.google.com/groups?hl=e...ublic.dotnet.*

you will get several posts, take a look at them and maybe you find a
solution :)
If you do , please post it back here to be archived.

Cheers,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation

"Marie-Christine Bechara" <ma*********************@ifsal.com> wrote in
message news:uc**************@tk2msftngp13.phx.gbl...
I mean by scanning the actual scanning of a document using the Scanner.
When i click on the Scan button, i need some kind of functionality that
allows me to scan.

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Nov 16 '05 #6

P: n/a
Hi,

A couple of articles that may help are
http://www.codeproject.com/dotnet/wi...tingdotnet.asp
http://www.codeproject.com/dotnet/twaindotnet.asp

Hope this helps

Publicjoe
C# Tutorial at http://www.publicjoe.f9.co.uk/csharp/tut.html
C# Snippets at http://www.publicjoe.f9.co.uk/csharp/snip/snippets.html
"Marie-Christine Bechara" <ma*********************@ifsal.com> wrote in
message news:eJ**************@tk2msftngp13.phx.gbl...
I have a form with a button called btnScan. When i click on this button
i want to scan a file and save it in the database. Any hints?? ideas???
solutions???

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Nov 16 '05 #7

P: n/a
Thanks, those articles are just what i need.

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 16 '05 #8

P: n/a
Third Party:

http://www.atalasoft.com/

from:

http://www.dotnet247.com/247referenc...41/208023.aspx

"Mike Kitchen" <pu*******@hotmail.com> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
Hi,

A couple of articles that may help are
http://www.codeproject.com/dotnet/wi...tingdotnet.asp
http://www.codeproject.com/dotnet/twaindotnet.asp

Hope this helps

Publicjoe
C# Tutorial at http://www.publicjoe.f9.co.uk/csharp/tut.html
C# Snippets at http://www.publicjoe.f9.co.uk/csharp/snip/snippets.html
"Marie-Christine Bechara" <ma*********************@ifsal.com> wrote in
message news:eJ**************@tk2msftngp13.phx.gbl...
I have a form with a button called btnScan. When i click on this button
i want to scan a file and save it in the database. Any hints?? ideas???
solutions???

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!


Nov 16 '05 #9

This discussion thread is closed

Replies have been disabled for this discussion.