FlyBoy Posted October 31, 2004 Posted October 31, 2004 ok,here i am again...first of all i want to say 10x again!! and now...i dont have any prob ...yet. but my question goes like this...is there anyway to work with an MDB\SQL database using VS.NET 2003 Architect enterprise without loading all this SQL servers stuff (the enterprise and\or the MSDE)??? i mean , i just want to load it from a folder that i will choose....the db should hold only users name..why do i need to make connections,and run servers for that ,when i can browse it and just load it into the program... any idea? Quote
stustarz Posted October 31, 2004 Posted October 31, 2004 (edited) Well, if that is the only functionality you need then i would personally go with an XML file and use the built in encryption classes to encrypt the file from external 'eyes'. - how to do this, i wouldnt know as ive never done it before! but that is how i would do it!! BUT..seeing as your trying to learn database integration with VB (you mentioned this in another post i think :) ) then why not: create a small database in Microsoft Access, with your users table. From there you can connect to it (Technically you are just creating a connection to a file). Using the OleDB Datacommand and Datareader functions you can perform SELECT, UPDATE, INSERT and all other SQL commands on the database...... Im not sure how much you know about this so i have included a very very basic implementation of populating a listview using an MDB (MS Access database) to show you what i mean :)VBForumDB.zip Edited November 1, 2004 by PlausiblyDamp Quote Visit: VBSourceSeek - The VB.NET sourcecode library "A mere friend will agree with you, but a real friend will argue."
FlyBoy Posted October 31, 2004 Author Posted October 31, 2004 Well, if that is the only functionality you need then i would personally go with an XML file and use the built in encryption classes to encrypt the file from external 'eyes'. - how to do this, i wouldnt know as ive never done it before! but that is how i would do it!! BUT..seeing as your trying to learn database integration with VB (you mentioned this in another post i think :) ) then why not: create a small database in Microsoft Access, with your users table. From there you can connect to it (Technically you are just creating a connection to a file). Using the OleDB Datacommand and Datareader functions you can perform SELECT, UPDATE, INSERT and all other SQL commands on the database...... Im not sure how much you know about this so i have included a very very basic implementation of populating a listview using an MDB (MS Access database) to show you what i mean :) well thanks for the file..and the help..again much appreciated...and im very happy to know that there are good ppls!!! and u think i've found a way to do that with an MDB file (which means that i didnt had to follow the book and intall the MSDE and such...i mean to work localy with MDB DB) instead of selecting the "Microsoft OLE DB Provider For SQL Server" i'll just work with the "Microsoft JET 4.0 OLE DB Provider" i know its MDB and not MDF.. but the Nwind DB is MDB...and i just want to learn SQL at this phase of studying...so i thinl it would be fine for now.... i dont get one thing...why when i drag the "Tables" from the solution explorer to the form (in c#) <<< thats what the books says to do... i get around 8 DataAdapters!!! and one dataconnection????? why the 8 dataadapters?????????? Quote
stustarz Posted October 31, 2004 Posted October 31, 2004 DataAdapters are used with Datasets - This is different to the method i have used in the sample code (which uses datacommands and datareaders) - which i have also coded in VB sorry! A dataAdapter consists of a SQL statement to execute against your database - one is created for each SQL statement: SELECT, INSERT, UPDATE and DELETE - dont know why your getting 8 though :) . I would only ever use this method of data access if i plan on doing a LOT of writing back to the databases underlying tables. If you are simply just reading from the database AVOID USING DATASETS - they are far more expensive on system resources - a datareader is a lot quicker! :D You can think of a dataset as a layer of data between your application and the database itself - any changes you make to this data is then saved into your database using the dataAdapter required to perform the function! It allows users to modify, insert and delete data retrieved by the dataadapter and then save all the changes at once - as i said - perfect if you plan to do this type of thing. Quote Visit: VBSourceSeek - The VB.NET sourcecode library "A mere friend will agree with you, but a real friend will argue."
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.