howde me again,
looking to databind to a textbow.
one column in my table. has anyone done this before ive had a go below but as usual, nothin happens, prob missin a line or 2, i want to do this so the data can be edited and then saved.
thanks in advance
Code:Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load 'Put user code to initialize the page here loadtextboxs() End Sub Private Sub loadtextboxs() 'connect to database 'Dim oSQLConn As SqlConnection = New SqlConnection oSQLConn.ConnectionString = "Data Source=(local);" & _ "Initial Catalog=TaT;" & _ "Integrated Security=SSPI" oSQLConn.Open() 'databind the infromation 'If SqlConnection1.State = ConnectionState.Closed Then SqlConnection1.Open() daCompMsg.SelectCommand = New SqlCommand("SELECT confirm_msg from tb_comp_msg ", oSQLConn) daCompMsg.Fill(dsCompMsg) 'DataGrid() ' txt_msg1.DataSource = dsCompMsg.Tables(0) txt_msg1.DataBind() oSQLConn.Close()




Reply With Quote