Chopper1980 Posted April 12, 2004 Posted April 12, 2004 I have a VB app connecting to a SQL database to insert new records in.. such as pictures, picture descriptions.. etc.. I want to be able to use a form i created to search this database for entries matching specific criteria.. such as names of entries and descriptions.. Unfortunately i have no experience at all with VB this advanced and was looking for some assistance... Cheers Quote
The One Who Was Posted April 17, 2004 Posted April 17, 2004 Chopper... You'll need to add a few components to your form: SQL Data Connection (Establishes a connection to the SQL Database) SQL Data Adapter (Uses the Data Connection to execute SQL Statements and return records to the dataset) Dataset (Stores records temporarily in local memory) If you add these at design time, you will find that the wizards are somewhat straight forward. It has wizards to help you create your connection strings and SQL statements. Great tools to help you until you become more familiar with the ADO.NET components. If you want to learn more about creating your own SQL commands, you may want to check out http://www.w3schools.com/sql/default.asp It has some good tutorials on creating SQL Select statements which is your starting point for viewing specific records. **You will need to manually add your tables to the dataset prior to filling it** **Also make sure that your components such as textboxs and grids are Data bound to the dataset to your liking** Once you have created the objects, you can use the following code to pull data to the dataset.... SqlDataAdapter.Fill(DataSet.Tables("TableName")) Once the dataset is filled, you may also use a dataview to further sort and search your records that are in your dataset. (Please note... to use a dataview you must bind your components to the dataview instead of the dataset) There are a lot of good posts as well on this website regarding this. I hope this is of some assistance to you :D Quote ~~ The One Who Was ~~
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.