Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Retreiving a Text field
Message
From
14/07/2009 13:07:36
 
General information
Forum:
ASP.NET
Category:
ADO.NET
Environment versions
Environment:
ASP.NET
Database:
MS SQL Server
Miscellaneous
Thread ID:
01412265
Message ID:
01412273
Views:
46
>>Hi all,
>>
>>I am trying to reteive and text from a Text data type field using Ado.net (and vb.Net). But all I seem to be getting is an integer value. Is there a special trick to retreiving it? And once I get it, and edit it, how would send it back to the server to save?
>
>Can you post some code?
>
>Also, may be it's better to switch to varchar(max) instead of Text?

As for changing the data type, the database is a pre-existing database and another application owns it. I am developing a Query By Example application where only the Comment (Text) field can be modified.

Here a snipit of code I am using to retreive the data.
lcCmd = "select * from " & lcTable & " where Number='" & lcNumber & "'"
Dim cm As SqlCommand = New SqlCommand()
cm.CommandText = lcCmd
cm.Connection = cn
dr = cm.ExecuteReader
dr.Read()

lcData = dr.Item("Comment").ToString()
Greg Reichert
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform