NETFAN

NETFAN

  • NA
  • 13
  • 0

I try to update GridView but get error

May 11 2005 7:37 AM
hi, I try to update a gridview, found million different ways to do it but which one works :s This is the markup code : Csharp code : protected void Page_Load(object sender, EventArgs e) { string connstring ="Data Source=R2D2\\NETSDK;Initial Catalog=Northwind;Integrated Security=True"; Conn = new SqlConnection (connstring); GridView_Schedule.DataBind(); } protected void Calender_Schedule_SelectionChanged(object sender, EventArgs e) { int day, month, year; string sql; day = Calender_Schedule.SelectedDate.Day; month = Calender_Schedule.SelectedDate.Month; year = Calender_Schedule.SelectedDate.Year; sql = "select * from schedule where Scheduleday='" + day.ToString() + "' and Schedulemonth='" + month.ToString() + "' and Scheduleyear='" + year.ToString() + "'"; SQLDS_Schedule.SelectCommand = sql; GridView_Schedule.DataBind(); } He always claims when I wanna do an update that "@scheduleID" is unknow. If I put it readonly false or visible true , it will work. But I want it to be hidden. It just doesnt look good a gridview with IDs of the records. Is there a way to do this without the ID column visible? Anyone? Thx Kind Regards NETFAN

Answers (2)