Click here to Skip to main content
15,895,740 members
Home / Discussions / Database
   

Database

 
QuestionSQL - DELETE Directive error Pin
ddmcr21-Oct-05 3:30
ddmcr21-Oct-05 3:30 
AnswerRe: SQL - DELETE Directive error Pin
Looney Tunezez21-Oct-05 3:51
Looney Tunezez21-Oct-05 3:51 
GeneralRe: SQL - DELETE Directive error Pin
ddmcr21-Oct-05 3:54
ddmcr21-Oct-05 3:54 
GeneralRe: SQL - DELETE Directive error Pin
André Ziegler21-Oct-05 5:15
André Ziegler21-Oct-05 5:15 
QuestionDisplaying date Pin
Anonymous21-Oct-05 3:25
Anonymous21-Oct-05 3:25 
AnswerRe: Displaying date Pin
Hesham Amin22-Oct-05 4:48
Hesham Amin22-Oct-05 4:48 
GeneralRe: Displaying date Pin
Anonymous23-Oct-05 23:04
Anonymous23-Oct-05 23:04 
Questioncalander value using query Pin
Member 184400621-Oct-05 2:24
Member 184400621-Oct-05 2:24 
error
Line 10:
Line 11:
Line 12: val1 = BeginDate.SelectedDate
Line 13: val2 =EndDate.SelectedDate
Line 14:




val1 =BeginDate.SelectedDate
val2 =EndDate.SelectedDate

Sub Get_Click(Sender As Object, E As EventArgs)


'Dim MyConnection As SqlConnection
'Dim MyCommand As String
'Dim strin As String=tb.Text
'Dim strout As String=tb1.Text
Dim dbpath


dbpath=Server.MapPath("..\staff2\database\Hotelmgt.mdb")

Dim objConnection as OleDbConnection
objConnection = New OleDbConnection("PROVIDER=Microsoft.Jet.OLEDB.4.0;DATA SOURCE=" &dbpath)
objConnection.Open()

Dim objCommand as OleDbCommand
objCommand = New OleDbCommand("SELECT HOTEL.Htlname, RATE.Roomtype, RATE.Datein, RATE.Dateout, RATE.Mealplan,RATE.Rate, RATE.Extnt FROM HOTEL INNER JOIN RATE

ON HOTEL.Htlid = RATE.Htlid WHERE (((RATE.Datein) >= val1)) AND ((RATE.Dateout) <= val2 ));",objConnection)
' objCommand = New OleDbCommand("SELECT HOTEL.Htlname, RATE.Roomtype, RATE.Datein, RATE.Dateout, RATE.Mealplan,RATE.Rate, RATE.Extnt FROM HOTEL INNER JOIN

'RATE ON HOTEL.Htlid = RATE.Htlid WHERE RATE.Datein Between [3/2/2005] And [6/1/2006] ORDER BY RATE.Datein",objConnection)
' bjCommand = New OleDbCommand("SELECT * FROM RATE WHERE (((RATE.Datein)>=#1/1/2004#) AND ((RATE.Dateout)<=#10/01/2005#));",objConnection)
'objCommand.SelectCommand.CommandType = CommandType.objCommand

'objCommand.SelectCommand.Parameters.Add(New Parameter("@Beginning_Date", DbType.DateTime))
'objCommand.SelectCommand.Parameters("@Beginning_Date").Value = BeginDate.SelectedDate
'("@Beginning_Date").Value = BeginDate.SelectedDate
'objCommand.SelectCommand.Parameters.Add(New Parameter("@Ending_Date", DbType.DateTime))
'objCommand.SelectCommand.Parameters("@Ending_Date").Value = EndDate.SelectedDate
'("@Ending_Date").Value = EndDate.SelectedDate
Dim objDataReader as OleDbDataReader
objDataReader = objCommand.ExecuteReader(CommandBehavior.CloseConnection)

MyDataGrid.DataSource = objDataReader
MyDataGrid.DataBind()


objDataReader.Close()



End Sub








Parameterized Stored Proc Select to a DataGrid Control




Start Date
<asp:calendar id="BeginDate"
="" borderwidth="2" bordercolor="lightblue" font-size="8pt" titlestyle-font-size="8pt" titlestyle-backcolor="#cceecc" dayheaderstyle-backcolor="#ddffdd" dayheaderstyle-font-size="10pt" weekenddaystyle-backcolor="#ffffcc" selecteddaystyle-backcolor="lightblue" runat="server">
End Date
<asp:calendar id="EndDate"
="" borderwidth="2" bordercolor="lightblue" font-size="8pt" titlestyle-font-size="8pt" titlestyle-backcolor="#cceecc" dayheaderstyle-backcolor="#ddffdd" dayheaderstyle-font-size="10pt" weekenddaystyle-backcolor="#ffffcc"

="" selecteddaystyle-backcolor="lightblue" runat="server">


<asp:datagrid id="MyDataGrid" runat="server"
="" width="500" backcolor="#ccccff" bordercolor="black" showfooter="false" cellpadding="3" cellspacing="0" font-name="Verdana" font-size="8pt" headerstyle-backcolor="#aaaadd" enableviewstate="false">







how to get the calander value and using in database



jebin
QuestionSearching for a list of words Pin
hasanali0021-Oct-05 1:59
hasanali0021-Oct-05 1:59 
QuestionFind an replace text in Row in a DataTable Pin
blackhole07720-Oct-05 11:59
blackhole07720-Oct-05 11:59 
AnswerRe: Find an replace text in Row in a DataTable Pin
S Douglas20-Oct-05 22:52
professionalS Douglas20-Oct-05 22:52 
GeneralRe: Find an replace text in Row in a DataTable Pin
blackhole07721-Oct-05 9:46
blackhole07721-Oct-05 9:46 
GeneralRe: Find an replace text in Row in a DataTable Pin
S Douglas23-Oct-05 22:01
professionalS Douglas23-Oct-05 22:01 
GeneralRe: Find an replace text in Row in a DataTable Pin
blackhole07724-Oct-05 9:27
blackhole07724-Oct-05 9:27 
GeneralRe: Find an replace text in Row in a DataTable Pin
S Douglas24-Oct-05 12:29
professionalS Douglas24-Oct-05 12:29 
GeneralRe: Find an replace text in Row in a DataTable Pin
S Douglas23-Oct-05 23:40
professionalS Douglas23-Oct-05 23:40 
GeneralRe: Find an replace text in Row in a DataTable Pin
blackhole07729-Oct-05 18:24
blackhole07729-Oct-05 18:24 
GeneralRe: Find an replace text in Row in a DataTable Pin
S Douglas30-Oct-05 16:05
professionalS Douglas30-Oct-05 16:05 
QuestionDetermining whether DataRow values have changed Pin
GazzaJ20-Oct-05 5:55
GazzaJ20-Oct-05 5:55 
QuestionSomeone answer my questions,please! Pin
Deema Jack20-Oct-05 2:55
Deema Jack20-Oct-05 2:55 
AnswerRe: Someone answer my questions,please! Pin
Colin Angus Mackay20-Oct-05 6:35
Colin Angus Mackay20-Oct-05 6:35 
QuestionWeb part database access Pin
phy6njsb20-Oct-05 0:30
phy6njsb20-Oct-05 0:30 
AnswerRe: Web part database access Pin
Michael Potter20-Oct-05 11:23
Michael Potter20-Oct-05 11:23 
GeneralRe: Web part database access Pin
phy6njsb20-Oct-05 22:48
phy6njsb20-Oct-05 22:48 
GeneralRe: Web part database access Pin
Michael Potter21-Oct-05 3:21
Michael Potter21-Oct-05 3:21 

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.