tasnim
|
Posted: 01/03/2006, 11:50 AM |
|
i want to display values in the edit page in aspx file.since i ddint no how to display it in asp:textbox i displayed it in inputbox in the value field using <input type="text" name="textfield2" id="textfield2" value="<%response.write(Session("tname").tostring())%>" />
and when i click edit button its trying to update using the update statemnet.
strSQL = "UPDATE TEACHERS SET DESIGNATION ='" & textfield2.text & "' where SID=" & str
but when i run the program its showing the message
BC30451: Name 'textfield2' is not declared.
what is the error.
how can you use asp:textbox value field to retrieve the field from the database using response.write
how to declare a variable globally in asp.net and how can you use it in the value field of asp:textbox.give me an exampe for it.
|
|
|
E43509
Posts: 283
|
Posted: 01/03/2006, 12:04 PM |
|
On the edit page, just add another field using the CCS IDE and make it a label field. As a label type field, this is not used in the sql update. Only input and hidden fields are automatically included.
Set its control source type to code expression and the control source to System.Web.HttpContext.Current.Session("tname")
If not a session varaible, you can point the control source for the label to any database field or in a before show, do a Dlookup event to retrieve the data and store it in that label control
|
|
|
UZAID
|
Posted: 05/09/2006, 12:03 AM |
|
Dim Str3 As String
Dim Con3 As OleDbConnection
Dim Cmd3 As OleDbCommand
Con3 = New OleDbConnection("PROVIDER=Microsoft.Jet.OLEDB.4.0;DATA Source=d:\pmmis_database\pmmis_web.mdb")
Con3.Open()
Str3= UPDATE Master_UOM set UOM_Des="' & txtudes.text& '" where UOM_ID="& Drop1.SelectedItem.Value &"
Cmd3= New OleDbCommand(Str3, Con3)
Cmd3.ExecuteNonQuery()
Con3.Close()
I am running the above given coding with aspx file and i am receiving given below error.
BC30451: Name 'UPDATE' is not declared.
Can anybody help !!!!!!!!
Thanks in advance..
|
|
|
Stan
|
Posted: 05/11/2006, 1:35 AM |
|
Your forgot a open quote in this line
Str3= UPDATE Master_UOM set UOM_Des="' & txtudes.text& '" where UOM_ID="& Drop1.SelectedItem.Value &"
It should looks as following
Str3= "UPDATE Master_UOM set UOM_Des='" & txtudes.text& "' where UOM_ID="& Drop1.SelectedItem.Value
|
|
|