予約 ID を使用してオンラインで予約を確認するシステムを作成しています。すべてのコードを実行しましたが、Web ブラウザーでアプリケーションを実行すると、「ページの読み込みに問題があります」というメッセージが表示されて切断されているように見えます。
これは、ボタンを押したときにシステムをチェックするために使用されるコードです
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)
{
}
}
}