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

Recommended Answers

All 3 Replies

>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?

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

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()
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.