473,386 Members | 1,734 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.

Field size in ADO.NET?

Hi all
In vb6 using ADO I can get the field size from recordset
for example: Size = Recordset.Fields(index).DefinedSize
How can I do it in vb.net using ADO.NET
Best regards

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 20 '05 #1
2 6271
Cor
Hi Wael,

Have a look at the datacolumn class,
http://msdn.microsoft.com/library/de...ClassTopic.asp
I hope this helps?

Cor
In vb6 using ADO I can get the field size from recordset
for example: Size = Recordset.Fields(index).DefinedSize
How can I do it in vb.net using ADO.NET
Best regards

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Nov 20 '05 #2

Hi Wael
You can get information needed by using
table schema with the FillSchema method of the DataAdapter
Dim da As SqlClient.SqlDataAdapter
Dim ds As New DataSet
Dim con As SqlClient.SqlConnection

Try
Dim con As New SqlClient.SqlConnection("Your connection ")
Dim da As New SqlClient.SqlDataAdapter(TableName , con)
da.FillSchema(ds, SchemaType.Source, "Schema")

' Field Length = ds.Tables("schema").Columns(FieldName).MaxLength

Catch ex As System.Exception
MsgBox(ex.Message)
End Try

Best regards
Sameh Refaat


*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 20 '05 #3

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

Similar topics

2
by: bob | last post by:
I am trying to find a simple way to determine the field size of a field in an Access table. I am writing a VB.NET Windows application. I would like a code snippet that I can get to work. I found...
2
by: toedipper | last post by:
Hello, What field size should I use to record a session id in a db? I use session_id() to generate it but I've noticed ones of different sizes (character lengths) when testing. Is there is...
1
by: Shamet | last post by:
Dear: Com.database, My name is Shamet, I am working with large questionnaire, I need your help to solve this problem, how can I increase the field size in the text data type, I want more 255...
1
by: oasd | last post by:
Is there any way to increase a text type field size to more then 255 characters? I tried Memo type field but i'm having difficulty exporting all text data entered into this field (for respective...
1
by: Omer kamal | last post by:
When in database(.mdb) the primary key have fields size type "Replication ID" it creates Guid. I tried to create string of Guid and insert it but did it not work. Control.databindings.add(),...
3
by: Adam Smith | last post by:
Hello, How does one adjust the input field size (height) in a form, say to accept 10pt rather than the 12pt txt that apparently is the norm. Thanks --Adam--
4
by: sparks | last post by:
Well I have an old database that all the text fields are set to 25-50 don't know why but I needed to change them all to 250. Well I wrote some code to change the size of the fields in the tables...
1
by: permanentlybaffled | last post by:
Hi, This is my first time using a forum, so here goes... I have an Access app that is in use by several people who know nothing about PC's. I included a few extra columns in each table to...
0
by: anuragshrivastava64 | last post by:
Hi All, I am currently preparing a database updation patch that copies tables and queries from one table to another.(using vb and ms-access) Can u please help me to increase the field size of...
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:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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,...

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.