Click here to Skip to main content
15,907,000 members
Home / Discussions / Visual Basic
   

Visual Basic

 
QuestionTreeNode Add/Remove/Disable issue in vb.net 2005 Pin
Andraw Tang5-Aug-10 11:12
Andraw Tang5-Aug-10 11:12 
AnswerRe: TreeNode Add/Remove/Disable issue in vb.net 2005 Pin
Andraw Tang5-Aug-10 12:08
Andraw Tang5-Aug-10 12:08 
GeneralRe: TreeNode Add/Remove/Disable issue in vb.net 2005 Pin
Tom Deketelaere5-Aug-10 22:25
professionalTom Deketelaere5-Aug-10 22:25 
GeneralRe: TreeNode Add/Remove/Disable issue in vb.net 2005 Pin
Andraw Tang6-Aug-10 3:33
Andraw Tang6-Aug-10 3:33 
QuestionDataGridView and combobox issue Pin
mecca15-Aug-10 9:37
mecca15-Aug-10 9:37 
Question[VB6] Problem with search data in Access database (windows form application) Pin
_ASPAle_5-Aug-10 1:22
_ASPAle_5-Aug-10 1:22 
AnswerRe: [VB6] Problem with search data in Access database (windows form application) Pin
AnnieMacD5-Aug-10 5:19
AnnieMacD5-Aug-10 5:19 
QuestionGet table field size Pin
cyberexel4-Aug-10 8:14
cyberexel4-Aug-10 8:14 
I have this code which is getting me most of the properties except the size of the field!

Private Sub Props()

        Dim sSql As String = "SELECT * from MyTable"

        Dim da As New SqlClient.SqlDataAdapter(sSql, conSQL)

        conSQL.Open()

        Dim ds As New DataSet
        da.Fill(ds)

        Dim sb As New StringBuilder
        Dim tbl As DataTable = ds.Tables(0)

        For Each col As DataColumn In tbl.Columns

            myProperties(0) = col.DataType.ToString()'I get correct values here
            myProperties(1) = col.MaxLength.ToString()' this return -1 for chars and varchars

        Next

End Sub


Could someone help me to get the size of the fields, eg if the field is 50 varchar, etc. Or a better way to help me get it if this code is not the proper way.

Thanks
AnswerRe: Get table field size Pin
Eddy Vluggen4-Aug-10 9:52
professionalEddy Vluggen4-Aug-10 9:52 
GeneralRe: Get table field size Pin
cyberexel4-Aug-10 23:13
cyberexel4-Aug-10 23:13 
GeneralRe: Get table field size Pin
Eddy Vluggen5-Aug-10 0:28
professionalEddy Vluggen5-Aug-10 0:28 
QuestionCannot find ContextMenu control in vb.net Pin
Andraw Tang4-Aug-10 6:30
Andraw Tang4-Aug-10 6:30 
AnswerRe: Cannot find ContextMenu control in vb.net Pin
cyberexel4-Aug-10 8:05
cyberexel4-Aug-10 8:05 
GeneralRe: Cannot find ContextMenu control in vb.net Pin
Andraw Tang4-Aug-10 10:25
Andraw Tang4-Aug-10 10:25 
GeneralRe: Cannot find ContextMenu control in vb.net Pin
cyberexel4-Aug-10 23:11
cyberexel4-Aug-10 23:11 
QuestionGet Primary Field and Foreign Fields from Access Table Pin
cyberexel4-Aug-10 4:49
cyberexel4-Aug-10 4:49 
AnswerRe: Get Primary Field and Foreign Fields from Access Table Pin
cyberexel5-Aug-10 6:39
cyberexel5-Aug-10 6:39 
QuestionRemote TCP file Transferring Pin
rezafathi3-Aug-10 14:15
rezafathi3-Aug-10 14:15 
AnswerRe: Remote TCP file Transferring Pin
Garth J Lancaster3-Aug-10 17:25
professionalGarth J Lancaster3-Aug-10 17:25 
Question[VB10] Check which ListBox items are selected and which are not Pin
The Mighty Atom3-Aug-10 9:43
The Mighty Atom3-Aug-10 9:43 
AnswerRe: [VB10] Check which ListBox items are selected and which are not Pin
Eddy Vluggen3-Aug-10 10:51
professionalEddy Vluggen3-Aug-10 10:51 
GeneralRe: [VB10] Check which ListBox items are selected and which are not Pin
The Mighty Atom3-Aug-10 11:53
The Mighty Atom3-Aug-10 11:53 
GeneralRe: [VB10] Check which ListBox items are selected and which are not Pin
Luc Pattyn3-Aug-10 12:31
sitebuilderLuc Pattyn3-Aug-10 12:31 
GeneralRe: [VB10] Check which ListBox items are selected and which are not [modified] Pin
The Mighty Atom3-Aug-10 13:01
The Mighty Atom3-Aug-10 13:01 
GeneralRe: [VB10] Check which ListBox items are selected and which are not Pin
The Mighty Atom4-Aug-10 7:14
The Mighty Atom4-Aug-10 7:14 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.