TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Priyank Khare
NA
256
75.7k
sql upate command
Jul 20 2012 8:49 AM
hello sir,
my problem is as folows:-
Amenities.aspx-
protected void roombtnselect_Click(object sender, EventArgs e)
{
string Id = null;
string hname = null;
string rtype = null;
foreach (GridViewRow row in GridView2.Rows)
{
CheckBox chkbx = (CheckBox)row.FindControl("CheckBox3");
if (chkbx.Checked)
{
hname = row.Cells[1].Text.ToString();
rtype = row.Cells[6].Text.ToString();
Id = Id+ "," + row.Cells[0].Text.ToString();
}
}
if (hname != "" && rtype!= " ")
{
//Id=Id.TrimStart(',');
hname = hname.TrimStart(',');
rtype = rtype.TrimStart(',');
Response.Redirect("room_type.aspx?d1=" + Id + "&d2=" + hname + "&d3=" +rtype);
}
}
room_type.aspx-
public void roominsrt()
{
aid = Request.QueryString["d1"].ToString();
hnm = Request.QueryString["d2"];
rtyp = Request.QueryString["d3"];
string ConnectionServer = ConfigurationManager.AppSettings.Get("ConnectionServer");
string sConn = clsdb.DecryptData(ConfigurationManager.AppSettings.Get("ConnectionString"));
SqlConnection con = new SqlConnection("Server=" + ConnectionServer + ";" + sConn);
con.Open();
string sql = "update Infl_HotelInventory_RoomType set Aminities='" + aid + "' where hotel_name='"+ hnm + "' and RoomType = '"+ rtyp + "'";
i_IBE.CommonDB.Execute(sql);
con.Close();
}
these are 2 related pages:- the error occurs in highlighted line which is. error is-
Object reference not set to an instance of an object.
please help me...whats wrong with the code..
thank you
Reply
Answers (
1
)
Jquery
Image Download