Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Need advise for SQL statement
Message
De
10/11/2004 06:05:21
 
 
À
Tous
Information générale
Forum:
ASP.NET
Catégorie:
ADO.NET
Titre:
Need advise for SQL statement
Versions des environnements
Environment:
VB.NET 1.1
OS:
Windows XP SP2
Network:
Windows 2000 Server
Database:
MS SQL Server
Divers
Thread ID:
00959905
Message ID:
00959905
Vues:
53
Dear All,
Does my SQL statement for date range, already correct or not?

Dim SQLTemp As New SqlConnection
Dim Cmd As New System.Data.SqlClient.SqlCommand
Dim DataReader As SqlClient.SqlDataReader

Dim mPrintDaily As String = "SELECT * FROM Daily WHERE UDate >= @mDateFrom AND UDate <= @mDateTo ORDER BY UDate"

Dim mFromDate As Date = C1DateEdit2.Text
Dim mToDate As Date = C1DateEdit2.Text
SQLTemp.ConnectionString = SQLConn1.ConnectionString
SQLTemp.Open()
Cmd.Connection = SQLTemp
Cmd.CommandType = CommandType.Text
Cmd.CommandText = mPrintDaily
Cmd.Parameters.Add("@mDateFrom", SqlDbType.DateTime)
Cmd.Parameters("@mDateFrom").Value = mFromDate
Cmd.Parameters.Add("@mDateTo", SqlDbType.DateTime)
Cmd.Parameters("@mDateTo").Value = mToDate
DataReader = Cmd.ExecuteReader


please advise ..

Regards
Winanjaya
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform