Newbie - Need to prevent duplicate entries..

Y

YMPN

Dear All,

Need your help on this issue that I have with asp.net application. I
would really appreciate your help.

I am using Formview to save data into the database, Fields are
(date_from, date_to, time_from, Time_To - All are datetime format and a
roomNumber taken from a value in dropdownlist)

My requirement is simple; I want to prevent other user making
reservation on the specific room with the same dates and times and
within those range.

How will I use sqldatasource insert or any other ways of inserting to
prevent duplicate..

I am sorry for the confusion, i am new to asp.net


Here is the code i am using: -------

<%@ Page Language="VB" AutoEventWireup="false"
CodeFile="insert2.aspx.vb" Inherits="adminaccess_insert2" %>

<%@ Register Assembly="eWorld.UI, Version=2.0.3.2310, Culture=neutral,
PublicKeyToken=24d65337282035f2"
Namespace="eWorld.UI" TagPrefix="ew" %>
<%@ Import Namespace="System.Net.Mail" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<div />
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$
ConnectionStrings:RoomReservationConnectionString3 %>"
InsertCommand="INSERT INTO [ReservationInfo]
([Date_From], [Date_To], [Time_From], [Time_To], [RoomNo])
VALUES
(@Date_From, @Date_To, @Time_From, @Time_To, @RoomNo)" >



<InsertParameters>
<asp:parameter Name="Date_From" Type="DateTime" />
<asp:parameter Name="Date_To" Type="DateTime" />
<asp:parameter Name="Time_From" Type="DateTime" />
<asp:parameter Name="Time_To" Type="DateTime" />
<asp:parameter Name="RoomNo" Type="String" />
</InsertParameters>
</asp:SqlDataSource>




<asp:FormView ID="FormView1" runat="server" DataKeyNames="Id"
DataSourceID="SqlDataSource1" DefaultMode="Insert">

<InsertItemTemplate>
Date_From:
<br />


<ew:CalendarPopup ID="Date_From" runat="server"

PostedDate=""
SelectedDate='<%# Bind("Date_From") %>'
ImageUrl="~/images/calendar4.jpg"
ControlDisplay="TextBoxImage"
UpperBoundDate="12/31/9999 23:59:59"
Culture="(Default)" Text="Select Date
From">
<ButtonStyle Font-Names="verdana"
Font-Size="8pt"
BackColor="#DEE37F" />
</ew:CalendarPopup>
<br />
<br />
Date_To:
<br />


<ew:CalendarPopup ID="Date_To" runat="server"
PostedDate="" SelectedDate='<%# Bind("Date_To") %>'
ImageUrl="~/images/calendar4.jpg"
ControlDisplay="TextBoxImage" UpperBoundDate="12/31/9999 23:59:59"
Culture="(Default)" Text="Select Date To">
<ButtonStyle Font-Names="verdana"
Font-Size="8pt" BackColor="#DEE37F" />
</ew:CalendarPopup>
<br />
<br />
Time From:
<br />

<ew:TimePicker ID="Time_From" runat="server"
ImageUrl="~/images/calendar3.jpg" NumberOfColumns="3"
LowerBoundTime="12/30/1899 07:00:00"
UpperBoundTime="12/30/1899 23:00:00"
ControlDisplay="TextBoxImage"
PopupLocation="Bottom" PopupWidth="170px"
PopupHeight="178px" EnableViewState="true"

SelectedValue='<%# Bind("Time_From", "{t}")
%>'
PostedTime="7:00 PM"
SelectedTime="12/30/1899 19:00:00"

Text="Select Time Start">
<SelectedTimeStyle BackColor="Khaki"
ForeColor="Black" />
<TimeStyle BackColor="SteelBlue"
ForeColor="White" />
<ButtonStyle BackColor="#DEE37F"
Font-Names="verdana" Font-Size="8pt" />
</ew:TimePicker>
<br />
<br />
Time To:
<br />


<ew:TimePicker ID="Time_To" runat="server"
ImageUrl="~/images/calendar3.jpg"
ControlDisplay="TextBoxImage"
NumberOfColumns="3" LowerBoundTime="11/25/3506 07:00:00"
UpperBoundTime="11/25/3506 23:00:00"
PopupLocation="Bottom" PopupWidth="170px"
PopupHeight="178px" SelectedValue='<%#
Bind("Time_To", "{0:t}") %>' PostedTime="7:00 PM"
SelectedTime="11/25/3506 19:00:28"
Text="Select Time Ends">
<SelectedTimeStyle BackColor="Khaki"
ForeColor="Black" />
<TimeStyle BackColor="SteelBlue"
ForeColor="White" />
<ButtonStyle BackColor="#DEE37F"
Font-Names="verdana" Font-Size="8pt" />
</ew:TimePicker>
<br />
<br />
RoomNo:
<asp:DropDownList ID="RoomNo" runat="server"
DataSourceID="SqlDataSource3" DataTextField="RoomNo"
AppendDataBoundItems="true"
DataValueField="RoomNo" SelectedValue='<%# Bind("RoomNo") %>'>
<asp:ListItem Selected="True">Pls. Select
Your Room No.</asp:ListItem>
</asp:DropDownList><br />
<br />

<%-- Start of DataSource --%>


<asp:SqlDataSource ID="SqlDataSource3" runat="server"
ConnectionString="<%$
ConnectionStrings:RoomReservationConnectionString %>"

SelectCommand="SELECT * FROM
[RoomInfo]"></asp:SqlDataSource>

<asp:LinkButton ID="InsertButton" runat="server"
CausesValidation="True" CommandName="Insert"
Text="Insert">
</asp:LinkButton>
<asp:LinkButton ID="InsertCancelButton" runat="server"
CausesValidation="False" CommandName="Cancel"
Text="Cancel">
</asp:LinkButton>


</InsertItemTemplate>
</asp:FormView>
<br />
<asp:Label ID="Label1" runat="server" Text="Label"
Height="18px" Visible="False"></asp:Label>

</form>
</body>
</html>
 
F

Flinky Wisty Pomm

This is really something you want to do in two places. Firstly, design
your UI such that it only offers the option of reserving a room which
is not yet taken. Have you considered using a calendar control of some
kind?

That would probably be more intuitive for use, and has the advantage
that you can only allow certain ranges to be selected.

Secondly, your database should be responsible for maintaining the
integrity of your data. The business rule "A room can be exclusively
reserved for a set of N days, and the time spans may not overlap" can
be handled as a constraint of some kind.

If you try to violate that constraint, your database will throw an
error, and you can handle the resulting exception in your code.

Dear All,

Need your help on this issue that I have with asp.net application. I
would really appreciate your help.

I am using Formview to save data into the database, Fields are
(date_from, date_to, time_from, Time_To - All are datetime format and a
roomNumber taken from a value in dropdownlist)

My requirement is simple; I want to prevent other user making
reservation on the specific room with the same dates and times and
within those range.

How will I use sqldatasource insert or any other ways of inserting to
prevent duplicate..

I am sorry for the confusion, i am new to asp.net


Here is the code i am using: -------

<%@ Page Language="VB" AutoEventWireup="false"
CodeFile="insert2.aspx.vb" Inherits="adminaccess_insert2" %>

<%@ Register Assembly="eWorld.UI, Version=2.0.3.2310, Culture=neutral,
PublicKeyToken=24d65337282035f2"
Namespace="eWorld.UI" TagPrefix="ew" %>
<%@ Import Namespace="System.Net.Mail" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<div />
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$
ConnectionStrings:RoomReservationConnectionString3 %>"
InsertCommand="INSERT INTO [ReservationInfo]
([Date_From], [Date_To], [Time_From], [Time_To], [RoomNo])
VALUES
(@Date_From, @Date_To, @Time_From, @Time_To, @RoomNo)" >



<InsertParameters>
<asp:parameter Name="Date_From" Type="DateTime" />
<asp:parameter Name="Date_To" Type="DateTime" />
<asp:parameter Name="Time_From" Type="DateTime" />
<asp:parameter Name="Time_To" Type="DateTime" />
<asp:parameter Name="RoomNo" Type="String" />
</InsertParameters>
</asp:SqlDataSource>




<asp:FormView ID="FormView1" runat="server" DataKeyNames="Id"
DataSourceID="SqlDataSource1" DefaultMode="Insert">

<InsertItemTemplate>
Date_From:
<br />


<ew:CalendarPopup ID="Date_From" runat="server"

PostedDate=""
SelectedDate='<%# Bind("Date_From") %>'
ImageUrl="~/images/calendar4.jpg"
ControlDisplay="TextBoxImage"
UpperBoundDate="12/31/9999 23:59:59"
Culture="(Default)" Text="Select Date
From">
<ButtonStyle Font-Names="verdana"
Font-Size="8pt"
BackColor="#DEE37F" />
</ew:CalendarPopup>
<br />
<br />
Date_To:
<br />


<ew:CalendarPopup ID="Date_To" runat="server"
PostedDate="" SelectedDate='<%# Bind("Date_To") %>'
ImageUrl="~/images/calendar4.jpg"
ControlDisplay="TextBoxImage" UpperBoundDate="12/31/9999 23:59:59"
Culture="(Default)" Text="Select Date To">
<ButtonStyle Font-Names="verdana"
Font-Size="8pt" BackColor="#DEE37F" />
</ew:CalendarPopup>
<br />
<br />
Time From:
<br />

<ew:TimePicker ID="Time_From" runat="server"
ImageUrl="~/images/calendar3.jpg" NumberOfColumns="3"
LowerBoundTime="12/30/1899 07:00:00"
UpperBoundTime="12/30/1899 23:00:00"
ControlDisplay="TextBoxImage"
PopupLocation="Bottom" PopupWidth="170px"
PopupHeight="178px" EnableViewState="true"

SelectedValue='<%# Bind("Time_From", "{t}")
%>'
PostedTime="7:00 PM"
SelectedTime="12/30/1899 19:00:00"

Text="Select Time Start">
<SelectedTimeStyle BackColor="Khaki"
ForeColor="Black" />
<TimeStyle BackColor="SteelBlue"
ForeColor="White" />
<ButtonStyle BackColor="#DEE37F"
Font-Names="verdana" Font-Size="8pt" />
</ew:TimePicker>
<br />
<br />
Time To:
<br />


<ew:TimePicker ID="Time_To" runat="server"
ImageUrl="~/images/calendar3.jpg"
ControlDisplay="TextBoxImage"
NumberOfColumns="3" LowerBoundTime="11/25/3506 07:00:00"
UpperBoundTime="11/25/3506 23:00:00"
PopupLocation="Bottom" PopupWidth="170px"
PopupHeight="178px" SelectedValue='<%#
Bind("Time_To", "{0:t}") %>' PostedTime="7:00 PM"
SelectedTime="11/25/3506 19:00:28"
Text="Select Time Ends">
<SelectedTimeStyle BackColor="Khaki"
ForeColor="Black" />
<TimeStyle BackColor="SteelBlue"
ForeColor="White" />
<ButtonStyle BackColor="#DEE37F"
Font-Names="verdana" Font-Size="8pt" />
</ew:TimePicker>
<br />
<br />
RoomNo:
<asp:DropDownList ID="RoomNo" runat="server"
DataSourceID="SqlDataSource3" DataTextField="RoomNo"
AppendDataBoundItems="true"
DataValueField="RoomNo" SelectedValue='<%# Bind("RoomNo") %>'>
<asp:ListItem Selected="True">Pls. Select
Your Room No.</asp:ListItem>
</asp:DropDownList><br />
<br />

<%-- Start of DataSource --%>


<asp:SqlDataSource ID="SqlDataSource3" runat="server"
ConnectionString="<%$
ConnectionStrings:RoomReservationConnectionString %>"

SelectCommand="SELECT * FROM
[RoomInfo]"></asp:SqlDataSource>

<asp:LinkButton ID="InsertButton" runat="server"
CausesValidation="True" CommandName="Insert"
Text="Insert">
</asp:LinkButton>
<asp:LinkButton ID="InsertCancelButton" runat="server"
CausesValidation="False" CommandName="Cancel"
Text="Cancel">
</asp:LinkButton>


</InsertItemTemplate>
</asp:FormView>
<br />
<asp:Label ID="Label1" runat="server" Text="Label"
Height="18px" Visible="False"></asp:Label>

</form>
</body>
</html>
 
F

Flinky Wisty Pomm

You're already using a calendar control. Apologies for imbecility. It's
only 5:30 pm and I'm generally not at my best until at least 9:00 :)

This is really something you want to do in two places. Firstly, design
your UI such that it only offers the option of reserving a room which
is not yet taken. Have you considered using a calendar control of some
kind?

That would probably be more intuitive for use, and has the advantage
that you can only allow certain ranges to be selected.

Secondly, your database should be responsible for maintaining the
integrity of your data. The business rule "A room can be exclusively
reserved for a set of N days, and the time spans may not overlap" can
be handled as a constraint of some kind.

If you try to violate that constraint, your database will throw an
error, and you can handle the resulting exception in your code.

Dear All,

Need your help on this issue that I have with asp.net application. I
would really appreciate your help.

I am using Formview to save data into the database, Fields are
(date_from, date_to, time_from, Time_To - All are datetime format and a
roomNumber taken from a value in dropdownlist)

My requirement is simple; I want to prevent other user making
reservation on the specific room with the same dates and times and
within those range.

How will I use sqldatasource insert or any other ways of inserting to
prevent duplicate..

I am sorry for the confusion, i am new to asp.net


Here is the code i am using: -------

<%@ Page Language="VB" AutoEventWireup="false"
CodeFile="insert2.aspx.vb" Inherits="adminaccess_insert2" %>

<%@ Register Assembly="eWorld.UI, Version=2.0.3.2310, Culture=neutral,
PublicKeyToken=24d65337282035f2"
Namespace="eWorld.UI" TagPrefix="ew" %>
<%@ Import Namespace="System.Net.Mail" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<div />
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$
ConnectionStrings:RoomReservationConnectionString3 %>"
InsertCommand="INSERT INTO [ReservationInfo]
([Date_From], [Date_To], [Time_From], [Time_To], [RoomNo])
VALUES
(@Date_From, @Date_To, @Time_From, @Time_To, @RoomNo)" >



<InsertParameters>
<asp:parameter Name="Date_From" Type="DateTime" />
<asp:parameter Name="Date_To" Type="DateTime" />
<asp:parameter Name="Time_From" Type="DateTime" />
<asp:parameter Name="Time_To" Type="DateTime" />
<asp:parameter Name="RoomNo" Type="String" />
</InsertParameters>
</asp:SqlDataSource>




<asp:FormView ID="FormView1" runat="server" DataKeyNames="Id"
DataSourceID="SqlDataSource1" DefaultMode="Insert">

<InsertItemTemplate>
Date_From:
<br />


<ew:CalendarPopup ID="Date_From" runat="server"

PostedDate=""
SelectedDate='<%# Bind("Date_From") %>'
ImageUrl="~/images/calendar4.jpg"
ControlDisplay="TextBoxImage"
UpperBoundDate="12/31/9999 23:59:59"
Culture="(Default)" Text="Select Date
From">
<ButtonStyle Font-Names="verdana"
Font-Size="8pt"
BackColor="#DEE37F" />
</ew:CalendarPopup>
<br />
<br />
Date_To:
<br />


<ew:CalendarPopup ID="Date_To" runat="server"
PostedDate="" SelectedDate='<%# Bind("Date_To") %>'
ImageUrl="~/images/calendar4.jpg"
ControlDisplay="TextBoxImage" UpperBoundDate="12/31/9999 23:59:59"
Culture="(Default)" Text="Select Date To">
<ButtonStyle Font-Names="verdana"
Font-Size="8pt" BackColor="#DEE37F" />
</ew:CalendarPopup>
<br />
<br />
Time From:
<br />

<ew:TimePicker ID="Time_From" runat="server"
ImageUrl="~/images/calendar3.jpg" NumberOfColumns="3"
LowerBoundTime="12/30/1899 07:00:00"
UpperBoundTime="12/30/1899 23:00:00"
ControlDisplay="TextBoxImage"
PopupLocation="Bottom" PopupWidth="170px"
PopupHeight="178px" EnableViewState="true"

SelectedValue='<%# Bind("Time_From", "{t}")
%>'
PostedTime="7:00 PM"
SelectedTime="12/30/1899 19:00:00"

Text="Select Time Start">
<SelectedTimeStyle BackColor="Khaki"
ForeColor="Black" />
<TimeStyle BackColor="SteelBlue"
ForeColor="White" />
<ButtonStyle BackColor="#DEE37F"
Font-Names="verdana" Font-Size="8pt" />
</ew:TimePicker>
<br />
<br />
Time To:
<br />


<ew:TimePicker ID="Time_To" runat="server"
ImageUrl="~/images/calendar3.jpg"
ControlDisplay="TextBoxImage"
NumberOfColumns="3" LowerBoundTime="11/25/3506 07:00:00"
UpperBoundTime="11/25/3506 23:00:00"
PopupLocation="Bottom" PopupWidth="170px"
PopupHeight="178px" SelectedValue='<%#
Bind("Time_To", "{0:t}") %>' PostedTime="7:00 PM"
SelectedTime="11/25/3506 19:00:28"
Text="Select Time Ends">
<SelectedTimeStyle BackColor="Khaki"
ForeColor="Black" />
<TimeStyle BackColor="SteelBlue"
ForeColor="White" />
<ButtonStyle BackColor="#DEE37F"
Font-Names="verdana" Font-Size="8pt" />
</ew:TimePicker>
<br />
<br />
RoomNo:
<asp:DropDownList ID="RoomNo" runat="server"
DataSourceID="SqlDataSource3" DataTextField="RoomNo"
AppendDataBoundItems="true"
DataValueField="RoomNo" SelectedValue='<%# Bind("RoomNo") %>'>
<asp:ListItem Selected="True">Pls. Select
Your Room No.</asp:ListItem>
</asp:DropDownList><br />
<br />

<%-- Start of DataSource --%>


<asp:SqlDataSource ID="SqlDataSource3" runat="server"
ConnectionString="<%$
ConnectionStrings:RoomReservationConnectionString %>"

SelectCommand="SELECT * FROM
[RoomInfo]"></asp:SqlDataSource>

<asp:LinkButton ID="InsertButton" runat="server"
CausesValidation="True" CommandName="Insert"
Text="Insert">
</asp:LinkButton>
<asp:LinkButton ID="InsertCancelButton" runat="server"
CausesValidation="False" CommandName="Cancel"
Text="Cancel">
</asp:LinkButton>


</InsertItemTemplate>
</asp:FormView>
<br />
<asp:Label ID="Label1" runat="server" Text="Label"
Height="18px" Visible="False"></asp:Label>

</form>
</body>
</html>
 
Y

YMPN

I really appreciate your response FWP. I need all the help that I can..

What you said...

"The business rule "A room can be exclusively
reserved for a set of N days, and the time spans may not overlap" can
be handled as a constraint of some kind.

If you try to violate that constraint, your database will throw an
error, and you can handle the resulting exception in your code.

--- end of qoute --

Can anybody please "translate" this into a working code that I may use
or assist me.

Thanks people...


You're already using a calendar control. Apologies for imbecility. It's
only 5:30 pm and I'm generally not at my best until at least 9:00 :)

This is really something you want to do in two places. Firstly, design
your UI such that it only offers the option of reserving a room which
is not yet taken. Have you considered using a calendar control of some
kind?

That would probably be more intuitive for use, and has the advantage
that you can only allow certain ranges to be selected.

Secondly, your database should be responsible for maintaining the
integrity of your data. The business rule "A room can be exclusively
reserved for a set of N days, and the time spans may not overlap" can
be handled as a constraint of some kind.

If you try to violate that constraint, your database will throw an
error, and you can handle the resulting exception in your code.

Dear All,

Need your help on this issue that I have with asp.net application. I
would really appreciate your help.

I am using Formview to save data into the database, Fields are
(date_from, date_to, time_from, Time_To - All are datetime format and a
roomNumber taken from a value in dropdownlist)

My requirement is simple; I want to prevent other user making
reservation on the specific room with the same dates and times and
within those range.

How will I use sqldatasource insert or any other ways of inserting to
prevent duplicate..

I am sorry for the confusion, i am new to asp.net


Here is the code i am using: -------

<%@ Page Language="VB" AutoEventWireup="false"
CodeFile="insert2.aspx.vb" Inherits="adminaccess_insert2" %>

<%@ Register Assembly="eWorld.UI, Version=2.0.3.2310, Culture=neutral,
PublicKeyToken=24d65337282035f2"
Namespace="eWorld.UI" TagPrefix="ew" %>
<%@ Import Namespace="System.Net.Mail" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<div />
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$
ConnectionStrings:RoomReservationConnectionString3 %>"
InsertCommand="INSERT INTO [ReservationInfo]
([Date_From], [Date_To], [Time_From], [Time_To], [RoomNo])
VALUES
(@Date_From, @Date_To, @Time_From, @Time_To, @RoomNo)" >



<InsertParameters>
<asp:parameter Name="Date_From" Type="DateTime" />
<asp:parameter Name="Date_To" Type="DateTime" />
<asp:parameter Name="Time_From" Type="DateTime" />
<asp:parameter Name="Time_To" Type="DateTime" />
<asp:parameter Name="RoomNo" Type="String" />
</InsertParameters>
</asp:SqlDataSource>




<asp:FormView ID="FormView1" runat="server" DataKeyNames="Id"
DataSourceID="SqlDataSource1" DefaultMode="Insert">

<InsertItemTemplate>
Date_From:
<br />


<ew:CalendarPopup ID="Date_From" runat="server"

PostedDate=""
SelectedDate='<%# Bind("Date_From") %>'
ImageUrl="~/images/calendar4.jpg"
ControlDisplay="TextBoxImage"
UpperBoundDate="12/31/9999 23:59:59"
Culture="(Default)" Text="Select Date
From">
<ButtonStyle Font-Names="verdana"
Font-Size="8pt"
BackColor="#DEE37F" />
</ew:CalendarPopup>
<br />
<br />
Date_To:
<br />


<ew:CalendarPopup ID="Date_To" runat="server"
PostedDate="" SelectedDate='<%# Bind("Date_To") %>'
ImageUrl="~/images/calendar4.jpg"
ControlDisplay="TextBoxImage" UpperBoundDate="12/31/9999 23:59:59"
Culture="(Default)" Text="Select Date To">
<ButtonStyle Font-Names="verdana"
Font-Size="8pt" BackColor="#DEE37F" />
</ew:CalendarPopup>
<br />
<br />
Time From:
<br />

<ew:TimePicker ID="Time_From" runat="server"
ImageUrl="~/images/calendar3.jpg" NumberOfColumns="3"
LowerBoundTime="12/30/1899 07:00:00"
UpperBoundTime="12/30/1899 23:00:00"
ControlDisplay="TextBoxImage"
PopupLocation="Bottom" PopupWidth="170px"
PopupHeight="178px" EnableViewState="true"

SelectedValue='<%# Bind("Time_From", "{t}")
%>'
PostedTime="7:00 PM"
SelectedTime="12/30/1899 19:00:00"

Text="Select Time Start">
<SelectedTimeStyle BackColor="Khaki"
ForeColor="Black" />
<TimeStyle BackColor="SteelBlue"
ForeColor="White" />
<ButtonStyle BackColor="#DEE37F"
Font-Names="verdana" Font-Size="8pt" />
</ew:TimePicker>
<br />
<br />
Time To:
<br />


<ew:TimePicker ID="Time_To" runat="server"
ImageUrl="~/images/calendar3.jpg"
ControlDisplay="TextBoxImage"
NumberOfColumns="3" LowerBoundTime="11/25/3506 07:00:00"
UpperBoundTime="11/25/3506 23:00:00"
PopupLocation="Bottom" PopupWidth="170px"
PopupHeight="178px" SelectedValue='<%#
Bind("Time_To", "{0:t}") %>' PostedTime="7:00 PM"
SelectedTime="11/25/3506 19:00:28"
Text="Select Time Ends">
<SelectedTimeStyle BackColor="Khaki"
ForeColor="Black" />
<TimeStyle BackColor="SteelBlue"
ForeColor="White" />
<ButtonStyle BackColor="#DEE37F"
Font-Names="verdana" Font-Size="8pt" />
</ew:TimePicker>
<br />
<br />
RoomNo:
<asp:DropDownList ID="RoomNo" runat="server"
DataSourceID="SqlDataSource3" DataTextField="RoomNo"
AppendDataBoundItems="true"
DataValueField="RoomNo" SelectedValue='<%# Bind("RoomNo") %>'>
<asp:ListItem Selected="True">Pls. Select
Your Room No.</asp:ListItem>
</asp:DropDownList><br />
<br />

<%-- Start of DataSource --%>


<asp:SqlDataSource ID="SqlDataSource3" runat="server"
ConnectionString="<%$
ConnectionStrings:RoomReservationConnectionString %>"

SelectCommand="SELECT * FROM
[RoomInfo]"></asp:SqlDataSource>

<asp:LinkButton ID="InsertButton" runat="server"
CausesValidation="True" CommandName="Insert"
Text="Insert">
</asp:LinkButton>
<asp:LinkButton ID="InsertCancelButton" runat="server"
CausesValidation="False" CommandName="Cancel"
Text="Cancel">
</asp:LinkButton>


</InsertItemTemplate>
</asp:FormView>
<br />
<asp:Label ID="Label1" runat="server" Text="Label"
Height="18px" Visible="False"></asp:Label>

</form>
</body>
</html>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top