Results 1 to 2 of 2

Thread: Add Field to Access DB in C# .Net

  1. #1

    Thread Starter
    New Member
    Join Date
    May 2002
    Location
    New Zealand
    Posts
    13

    Add Field to Access DB in C# .Net

    I have an access DB that I want to add a new field to a table in C#.Net

    Previously I have been doing this by creating an OLEDB Connection and running the ALTER TABLE SQL statement. This works fine.

    But now I want to set some of the properties of the field (Allow Zero Length, Required, Default Value, Unicode Compression etc).
    And haven't yet been able to find a way to do this.

    Can anyone out there help me!!

  2. #2
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    The only way I could found is by utilizing ADOX library . Here's an example in VB.NET(didn't have time to port it to C#) .It creates new blank database with all the fields and the settings you choose . Have a look at the ADOX.DataTypeEnum (if I still remember the name correctly) .http://www.vbforums.com/showthread.p...hreadid=251384

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width