Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Need advise for SQL statement
Message
From
10/11/2004 06:05:21
 
 
To
All
General information
Forum:
ASP.NET
Category:
ADO.NET
Title:
Need advise for SQL statement
Environment versions
Environment:
VB.NET 1.1
OS:
Windows XP SP2
Network:
Windows 2000 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
00959905
Message ID:
00959905
Views:
51
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
Next
Reply
Map
View

Click here to load this message in the networking platform