0

Hi Friends well i m developing an application into asp.net database is access

now i want to show a particular record into 1 textbox names txtbox1 here is code plz give me code that i can show record into textbox

Imports System.Data.OleDb

Partial Class Default123
Inherits System.Web.UI.Page


Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load



Dim vparam, dbconn, sql, dbcomm, dbread

dbconn = New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;data source=" & Server.MapPath("abcd.mdb"))

dbconn.Open()
vparam = Request.QueryString.Get("un")
sql = "SELECT * FROM user_login where user_name=vparam "
dbcomm = New OleDbCommand(sql, dbconn)


dbread = dbcomm.ExecuteReader()
Repeater1.DataSource = dbread
Repeater1.DataBind()



dbread.Close()
dbconn.Close()
End Sub



End Class

Edited by __avd: Added [code] tags. Do wrap your programming code blocks within [code] ... [/code] tags

2
Contributors
3
Replies
4
Views
6 Years
Discussion Span
Last Post by __avd
0

>now i want to show a particular record into 1 textbox names txtbox1

Hi! did you get any error? You want to show a record into a "TextBox1"'s Text property - so, tell us how many columns a row has?

0

yea just like text1.text=rs!cloumn name which v use in asp

i have to show only a record which is filtered by get query string

0
dbconn.Open()
vparam = Request.QueryString.Get("un")
sql = "SELECT * FROM user_login where user_name='vparam'"
dbcomm = New OleDbCommand(sql, dbconn)

dbread = dbcomm.ExecuteReader()
if dbread.read() then
  TextBox1.Text= dbread.getString(0) '1st column
  TextBox2.Text=dbread.getString(1) ' 2nd column
End if

dbread.Close()
dbconn.Close()
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.