Wrox Home  
Search P2P Archive for: Go

  Return to Index  

aspx thread: TIP! DataBinding in BETA 2 will be easrer.


Message #1 by "Fredrik Normen" <fredrik.normen@s...> on Thu, 21 Sep 2000 09:49:25 +0100
the data binding story will get easier in beta2.

There will be support for direct binding to a DataReader on all of the

controls.



For example, you'll be able to write (in Beta1):



	Dim myConn As SQLConnection = new

SQLConnection("server=localhost;uid=sa;pwd=;database=NorthWind

;")

	Dim myCommand = SQLCommand = new new SQLCommand("select * from

customers", myConn)



	Dim reader As SQLDataReader

	myConn.Open()

	myCommand.Execute(reader)



	myDataGrid.DataSource = reader

	myDataGrid.DataBind()



	myConn.Close()



In Beta2, this will get cleaned up further to just be:



	Dim myConn = SQLConnection = new

SQLConnection("server=localhost;uid=sa;pwd=;database=NorthWind

;")

	Dom myCommand As SQLCommand = new SQLCommand("select * from

cusotmers",myConn)



	myConn.Open()



	myDataGrid.DataSource = myCommand.Execute()

	myDataGrid.DataBind()



	myConn.Close()





/Fredrik Normen


  Return to Index