dear friends i want show record from database to textbox but i cannot do it shows nothing here is code newuser.aspx.vb
Imports System.Data.OleDb
Partial Class Edit_NewUser
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, objdatareader
dbconn = New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;data source=" & Server.MapPath("db1.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
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
End Sub
End Class
and in asp html file
<%@ Page Language=“VB” AutoEventWireup=“false” CodeFile=“Edit_NewUser.aspx.vb” Inherits=“Edit_NewUser” %>
<%@ Import Namespace=“System.Data.OleDb” %>
<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN” “http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”>
why i need itemtemplate tag i have to show only 1 records at a time into text box in vb we uses text1.text=rs!column_name in asp.net bind textbox wht i use
I do not understand what you mean. A repeater shows 1 item for each record in your dataset. If you only have 1 textbox and only 1 record all the time. Then you need to not used a repeater at all and on the codebehind, read the from the reader and apply it to the text of the textbox
there r three text boxes named txtfname, txtlname, txtpassword n in database field f _name,l_name,u_password now i want to show that particular record of all field into 3 textboxes i need code
Like I said, on the code-behind page, create a SqlDataReader. Then while it is reading apply the values to the textboxes that is not in a repeater. Google for the code, I do not know VB that well, and besides, I gave you a a direction and it would be better for you to figure it out by yourself instead of someone just giving you the code.
Give a man fish and feed him for a day, teach a man to fish and feed him for a life time.