473,386 Members | 1,699 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Read SQL Server LongVarChar (text) Feild

Hi All

I am trying to read a LongVarChar field from SQL Server using the
SqlDataReader and I am having trouble. Can anyone provide an example or
assistance.

I found the article
http://support.microsoft.com/default...b;en-us;316887 to read
LongVarBinary fields but I have been unable to convert this example to read a
text field, as I get the error "Specified cast is not valid.".

Any assistance would be appreciated.

Thanks
Nov 21 '05 #1
1 3114
David,

Normally you can use simple the CStr or the toString in my opinion.

However for this purpose are in my opinion the type convert functions from
Visual Basic very strong tools which stands to our purpose. For me is this
one of the great benefits from VBNet. (They are probably not so often used
in samples on MSDN because they are specific to VBNet however a full part of
the framework).

http://msdn.microsoft.com/library/de...Conversion.asp
I hope this helps?

Cor

"David" <Da***@discussions.microsoft.com>
Hi All

I am trying to read a LongVarChar field from SQL Server using the
SqlDataReader and I am having trouble. Can anyone provide an example or
assistance.

I found the article
http://support.microsoft.com/default...b;en-us;316887 to read
LongVarBinary fields but I have been unable to convert this example to
read a
text field, as I get the error "Specified cast is not valid.".

Any assistance would be appreciated.

Thanks

Nov 21 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

13
by: Graham | last post by:
I need a SQL Server or ODBC package for Python. Can anyone help please? Have search the Python packages under Database and there is no reference to either SQL Server or ODBC. Thanks Graham
9
by: Andrew Durstewitz | last post by:
Hi! I am having a really strange issue. I have a few users calling in saying they are getting an error. On further review I found this line is what is causing it... Set strLookup =...
3
by: Naren Mehta | last post by:
I have a table whose rowsize is nearing 4005 bytes and I want to increase the length of one column. I know I have two ways to do this. I can either increase the tablespace pagesize from 4K to 8K,...
3
by: AxOn | last post by:
Hi, I have an application with a Save function. I want to be able to have several tabs(each containing a RichTextBox, created at runtime) open in a tabControl and save the text from each...
1
by: TARUN | last post by:
Hello All Please help me for understanding of use of Hidden Feild in Programming, I am a beginner of C#.NET, can anyone give me the idea about hidden feild like hidden textBox, hidden textArea...
10
by: Richard Gilmore | last post by:
I want the feild total to display the total cost of an item, If the item has vat a yes no box is ticked in the field vat and I have the price of the item without vat. I want the feild total to...
3
by: orita | last post by:
Hello all, I need heeeeeeeeeeeeeeeelp... how can I enable/disable a few text box after clicking a radio button? I found this code in this site but it's only refer to one text feild and I...
3
by: nehaquick | last post by:
I have a form where the user has to enter values. to make it easy for the user there are some values already present in the feilds but if the user wants he can change it. the problem is i want to...
6
by: gavy7210 | last post by:
hello i am using struts 1.2,Eclipse Platform Version: 3.4.2,mySql 5.0.1,jdk 1.5.. i have a login form(jsp) in which a user logs in,in case he doesnt enter his username and/or password an error...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.