0

我正在制作一个使用预订 ID 在线检查预订的系统,我已经完成了所有代码,当我在网络浏览器上运行我的应用程序时,它似乎与消息“问题加载页面”断开连接

这是按下按钮时用于检查系统的代码

protected void Button1_Click(object sender, EventArgs e)
{
    int custval = 70757;

    if (BookID.Text == Convert.ToString(custval))
    {
        try
        {
            SqlConnection GuestBookings = new SqlConnection("Data Source=dell-vostro;Initial Catalog=HotelConference;Persist Security Info=True;User ID=website_application_testing;Password=***********");

            SqlCommand sc = new SqlCommand();
            sc.Connection = GuestBookings;
            GuestBookings.Open();
            sc.CommandText = ("SELECT CustomerFirstName, CustomerLastName FROM tblBookingGuests WHERE BookingID="+BookID.Text+")");
            sc.ExecuteNonQuery();
            GuestBookings.Close();
        }
        catch (Exception ex)
        {
        }
    }
}
4

0 回答 0