deleting a DS

I have a rather large TABLE in a DATABASE with about 200 or so columns
part of my app calls a DS with about 50 of those columns in the SET
they are bound to a datagridview on a form, but the SET is not loaded for this chunk of code

what I want to do is DELETE the columns of the MAIN DATABASE TABLE of the smaller DS

?'s
Must I fill the dataset CLEAR ALL COLUMNS and the reupdate ?
How do I do this?
MBHEY131Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

ElrondCTCommented:
I'm not entirely clear what you're asking. By "DS," do you mean a dataset? What do you mean by "the smaller DS"? Do you want to remove the columns of data from the actual database stored on disk? If so, how is the database stored on disk? Is it an Access database, SQL Server, Excel spreadsheet, or something else? Or do you simply want to blank out the values of those columns, so they can be used later? Keep in mind that if you delete the columns from the database, all your Select and Update commands will have to be rewritten.

Which version of Visual Basic are you using?
0
MBHEY131Author Commented:
I just want to blank out the columns and reapply the set to the database
the smaller set is part of the main table in the database
0
ElrondCTCommented:
You may be able to execute global commands directly against the database (that is, a single command that applies to all records), rather than loading and updating by record. To do that, we need to know what kind of database you have (Access, SQL Server, etc.).
0
MBHEY131Author Commented:
SQL SERVER
0
ElrondCTCommented:
If you have an OleDBConnection open, you can use the following commands:
            ' field2 is set to two single quotes (empty string)
            Dim strUpdate as String = "UPDATE Table1 SET field1 = 0, field2 = '' " 
            Dim cmd As OleDbCommand = New OleDbCommand(strUpdate, odbconn)
            cmd.ExecuteNonQuery()

Open in new window

This will work must faster than updating by individual record with a .Update method.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic.NET

From novice to tech pro — start learning today.