Click here to Skip to main content
15,894,017 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I want to make an app that needs database. I already made an access database with below information.
2 columns: Name and Family
in first row Name:John and family:wood
in second row Name:sara and family:Cage
i connected database to C# and made data adapter, data connection, dataset and data binding source and showed my file into a data grid view. till now it works perfect and i can add more names into my database but how can i search into Name column? and if Name doesn't exist show **name doesn't exist** and if it exist show her/his family in label1. i have no idea about how to search.thanks in advance.



C#
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace main
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }
        private void btnSearch_Click(object sender, EventArgs e)
        {
            //code for search
        }
    }
}
Posted
Updated 12-May-14 0:58am
v3

1 solution

This CodeProject article Simple Movie Database in C# using Microsoft Access[^] presents a simple application using Access.
As the author himself states
Quote:
... the provided code snippets are useful, i.e. connecting to *.mdb file, read/write data, using dataGridView control, adding buttons to cells, etc.
 
Share this answer
 
Comments
Akira98 12-May-14 7:29am    
I get this message when i upgrade solution and build it. The microsft.Jet.OLEDB.4.0 provider is not registered on the local machine
Akira98 12-May-14 7:35am    
I solved the error, trying to understand the code.
CHill60 12-May-14 7:52am    
Yeah - things have moved on a bit since it was written - this site is useful for connecting http://www.connectionstrings.com/[^] and it is usually up to date.
If you have any problems you can always come back and ask, or post a comment to the article. Good Luck!
Akira98 17-May-14 14:34pm    
thanx, i tried it and made a database my self but some parts are not clear for me. i added some more comment (// explanation ) in the code and upload it i would be grateful if you could explain it to me. http://www.uploadbaz.com/t7vwvtmzociz

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900