Click here to Skip to main content
16,005,121 members
Home / Discussions / C#
   

C#

 
GeneralProblem with LIKE ' *xxx* ' Pin
quocpt28-May-05 16:18
quocpt28-May-05 16:18 
GeneralRe: Problem with LIKE ' *xxx* ' Pin
Luis Alonso Ramos28-May-05 17:35
Luis Alonso Ramos28-May-05 17:35 
GeneralRe: Problem with LIKE ' *xxx* ' Pin
Colin Angus Mackay28-May-05 22:08
Colin Angus Mackay28-May-05 22:08 
GeneralRe: Problem with LIKE ' *xxx* ' Pin
Luis Alonso Ramos29-May-05 12:52
Luis Alonso Ramos29-May-05 12:52 
GeneralRe: Problem with LIKE ' *xxx* ' Pin
Colin Angus Mackay28-May-05 22:47
Colin Angus Mackay28-May-05 22:47 
GeneralRe: Problem with LIKE ' *xxx* ' Pin
quocpt29-May-05 1:53
quocpt29-May-05 1:53 
GeneralReading from a text file and then storing into the database Pin
mhmo28-May-05 9:44
mhmo28-May-05 9:44 
GeneralRe: Reading from a text file and then storing into the database Pin
Robert Rohde28-May-05 9:53
Robert Rohde28-May-05 9:53 
First of all you will need to open a connection to the database. Depending on which db you want to write to choose one of the providers coming with the framework (OleDb, ODBC...). If you need it fast you'll probably have to test them.

If its possible I would define a stored procedure in the database. Otherwise you will have to make a parameterized query. Once this is done the reading can begin.

You will now need a FileStream to open the file and read it line by line. Depending on the format you will have to split each line some way and fill in the parameters to your query. Execute it and go fopr the next line.

Thats it. Smile | :)
GeneralRe: Reading from a text file and then storing into the database Pin
mhmo28-May-05 19:14
mhmo28-May-05 19:14 
GeneralRe: Reading from a text file and then storing into the database Pin
Robert Rohde28-May-05 20:31
Robert Rohde28-May-05 20:31 
GeneralRe: Reading from a text file and then storing into the database Pin
Uri Lavi28-May-05 10:04
Uri Lavi28-May-05 10:04 
GeneralRe: Reading from a text file and then storing into the database Pin
mhmo28-May-05 21:07
mhmo28-May-05 21:07 
GeneralRe: Reading from a text file and then storing into the database Pin
Uri Lavi28-May-05 23:09
Uri Lavi28-May-05 23:09 
GeneralURGENT URGENT Pin
falandas28-May-05 2:46
falandas28-May-05 2:46 
GeneralRe: URGENT URGENT Pin
WillemM28-May-05 5:20
WillemM28-May-05 5:20 
GeneralRe: URGENT URGENT Pin
Christian Graus28-May-05 11:52
protectorChristian Graus28-May-05 11:52 
Generalenum overloading Pin
hasansheik28-May-05 2:28
hasansheik28-May-05 2:28 
GeneralRe: enum overloading Pin
Robert Rohde28-May-05 3:17
Robert Rohde28-May-05 3:17 
GeneralRe: enum overloading Pin
S. Senthil Kumar28-May-05 19:03
S. Senthil Kumar28-May-05 19:03 
QuestionSql or Xml ? Pin
MoustafaS28-May-05 2:27
MoustafaS28-May-05 2:27 
AnswerRe: Sql or Xml ? Pin
Robert Rohde28-May-05 3:27
Robert Rohde28-May-05 3:27 
GeneralRe: Sql or Xml ? Pin
MoustafaS28-May-05 3:57
MoustafaS28-May-05 3:57 
GeneralDataGrid DoubleClick Event Pin
Afief28-May-05 2:26
Afief28-May-05 2:26 
GeneralRe: DataGrid DoubleClick Event Pin
hasansheik28-May-05 2:31
hasansheik28-May-05 2:31 
GeneralRe: DataGrid DoubleClick Event Pin
Afief28-May-05 2:58
Afief28-May-05 2:58 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.