Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Datagrid Control > Displaying results in text box from a hyperlink coulm in datagrid

Reply
Thread Tools

Displaying results in text box from a hyperlink coulm in datagrid

 
 
Nithin
Guest
Posts: n/a
 
      01-12-2004
HI,
I have a datagrid that displays records. I have a hyperlink column
with a link to another page called "reportcal_details.aspx". Users can
go to the details page where they see all their information in text
box fields and update information.

My datagrid and hyperlink column works fine and I am able to send the
value of the "Ticket_id" (primary key) to the next page with the query
string in the URL
http://localhost/myprojects/tasktra...icket_id=20001.

I am even able to print this Ticket_id on my reportcal_details.aspx
page. But, I am unable to display the values for that Ticket_id inside
a text box that the users can update.

Here is the code for the details page. I have included just one text
box to make it easier.

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
Dim _reader As SqlDataReader
Dim strTicketId As String = Request.QueryString("Ticket_id")
Response.Write("The Ticket ID is " + strTicketId + "<br>")

Dim strSQL2 As String = "SELECT Bsc" & _
"FROM Tracker2" & _
"WHERE Ticket_id= '" & strTicketId & "'"
Dim objCmd As New SqlCommand(strSQL2, MyConnection)

Try
MyConnection.Open()
_reader = objCmd.ExecuteReader()
If _reader.Read Then
txtBsc.Text = "Bsc"
End If
_reader.Close()
Catch ex As SqlException
Response.Write(ex.ToString)
MyConnection.Close()

End Try
End Sub

Here is how my ERROR page appears:

The Ticket ID is 20001

System.Data.SqlClient.SqlException: Line 1: Incorrect syntax near
'Ticket_id'. at System.Data.SqlClient.SqlCommand.ExecuteReader(Com mandBehavior
cmdBehavior, RunBehavior runBehavior, Boolean returnStream) at
System.Data.SqlClient.SqlCommand.ExecuteReader() at
tasktracker.reportcal4_details.Page_Load(Object sender, EventArgs e)
in C:\Inetpub\wwwroot\myprojects\tasktracker\reportca
l4_details.aspx.vb:line 41
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
div box questions; float text around a box, fit box to image size Gnarlodious HTML 4 05-05-2010 11:30 AM
How to add a hyperlink column to asp.net datagrid - where only one value is a hyperlink davetichenor ASP .Net 1 10-30-2006 02:57 PM
How to add a hyperlink column to asp.net datagrid - where only one value is a hyperlink Dave ASP .Net Datagrid Control 0 10-21-2006 07:48 PM
displaying Hyperlink in Text Area Ezee Java 1 08-17-2005 07:21 PM
Displaying results as "pages" of a JTable and sorting across all results ... Monique Y. Mudama Java 1 06-28-2005 01:01 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57