HighTechTalks DotNet Forums  

Problems with SQL.

Dotnet VJSharp microsoft.public.dotnet.vjsharp


Discuss Problems with SQL. in the Dotnet VJSharp forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
Christian-Josef Schrattenthaler
 
Posts: n/a

Default Problems with SQL. - 05-23-2005 , 03:38 PM






Hi!

I want to make a logfile for my login-page (login-page allready works). I
use a MDB file which contains a table for each month. In the tables ar the
fields: Id, Datum, Uhrzeit, EMailAdresse and Kundennummer.

I tried to create the code, but I didn't understand some things. I marked
them with "???". And I can't find the end for the sql-command, this means
the sending of the sql-command.

Here is my code:

***
void Page_Load(Object sender, System.EventArgs e) {

// Aktuelle Uhrzeit in dtTemp speichern:
DateTime dtTemp = DateTime.get_Now();

// Benötigte Daten:
// """"""""""""""""
// Monat: month
// Datum: date
// Uhrzeit: time
// EMailAdresse: email
// Kundennummer: kdnr
String month = dtTemp.ToString("MMMM");
String date = dtTemp.ToString("yyyy-mm-dd");
String time = dtTemp.ToString("HH:mm:ss");
String email = "info (AT) businessname (DOT) com";
String kdnr = "20001";

// Gesammelte Daten am Bildschirm ausgeben:
get_Response().Write(month +"<br>");
get_Response().Write(date +"<br>");
get_Response().Write(time +"<br>");
get_Response().Write(email +"<br>");
get_Response().Write(kdnr +"<br>");

// Die Zugriffsart und die Datenbank festlegen:
String myCon = "Provider=Microsoft.Jet.OLEDB.4.0;";
myCon += "Data Source=C:/Inetpub/wwwroot/test/cjsTest_3/db1.mdb;";

// ???
OleDbConnection dbcon = new OleDbConnection(myCon);

// ???
dbcon.Open();

// Den SQL-Befehl erzeugen:
String sqlCommand = "INSERT INTO " +month +" (Datum, Uhrzeit,
EMailAdresse, Kundennummer) ";
sqlCommand += "VALUES (" +date +", " +time +", " + email +", " +kdnr
+")";

// sqlCommand am Bildschirm ausgeben:
get_Response().Write(sqlCommand);

// ???
OleDbCommand dbcom = new OleDbCommand(sqlCommand,dbcon);

//
// ???
//

//
dbcon.Close();

}
***

Can anyone help me?

Thanks and greetings,
christian.



Reply With Quote
  #2  
Old   
Christian-Josef Schrattenthaler
 
Posts: n/a

Default Re: Problems with SQL. - 05-24-2005 , 06:11 AM






I could resolve the problem!
Now I have only to do some tuning...

Greetings,
christian.

Reply With Quote
  #3  
Old   
Christian-Josef Schrattenthaler
 
Posts: n/a

Default Re: Problems with SQL. - 05-25-2005 , 03:27 AM



Hi Lars-Inge!

Quote:
I use a Microsoft Small Business Server 2003 Premium Edition.

Excellent choice! We are running that server in the BMW Car Club
Norway too. )
I know, but there is many to do, if the server should run clearly. The
SBS2003 is also the reason, why I want to change my PHP-Sites to
ASP.NET!

Quote:
In that case I guess you have to use the JET/Access.
This means I should use my Access-Database-Files, oder I should use
MS-SQL?

Greetings,
christian.



Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.