Click here to Skip to main content
15,887,596 members
Home / Discussions / C#
   

C#

 
AnswerRe: How to store images and retrive them to Data Grid View in database C#? Pin
Zafar Sultan28-Jul-08 19:01
Zafar Sultan28-Jul-08 19:01 
QuestionRemote Connection (SQL Server) Pin
mehrdadc4827-Jul-08 9:24
mehrdadc4827-Jul-08 9:24 
QuestionRe: Remote Connection (SQL Server) Pin
Paul Conrad27-Jul-08 9:59
professionalPaul Conrad27-Jul-08 9:59 
AnswerRe: Remote Connection (SQL Server) Pin
Wendelius27-Jul-08 10:35
mentorWendelius27-Jul-08 10:35 
QuestionCalling two ethods in a button click action Pin
WebMaster27-Jul-08 8:29
WebMaster27-Jul-08 8:29 
AnswerRe: Calling two ethods in a button click action Pin
Guffa27-Jul-08 8:52
Guffa27-Jul-08 8:52 
AnswerRe: Calling two ethods in a button click action Pin
Christian Graus27-Jul-08 10:14
protectorChristian Graus27-Jul-08 10:14 
QuestionDatabase with MS Acess Pin
benjamin yap27-Jul-08 4:58
benjamin yap27-Jul-08 4:58 
Hi, i got a database created in ms access 2003. Inside the database, there are 6 tables and a few relationship.

I want to link my database to my inventory system.

My inventory system is created based on MDI. When the application is loaded, the login form is begin created

childLogin = new FrmLogin();
     childLogin.ShowDialog(this);
     if (childLogin.DialogResult == DialogResult.OK)
     {
         stripLblLoginAs.Text = "Login As : " + childLogin.Username;
     }


I have added a existing datafile to my project (ebms.mdb). I also created a DatabaseManager.cs to check the connection

public class DatabaseManager
{
    public OleDbConnection connection;
    public OleDbDataAdapter dataAdapter;
    public DataSet dataSet;
    public string connectionString = @"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=ebms.mdb";

    public bool GetDataConnection()
    {
        try
        {
            connection = new OleDbConnection(connectionString);
            dataAdapter = new OleDbDataAdapter("select * from staff", connectionString);
            dataSet = new DataSet();
            dataAdapter.Fill(dataSet, "Staff");
            return true;
        }
        catch (Exception ex)
        {
            MessageBox.Show("Error : " + ex.Message);
            return false;
        }

    }
}



Now, inside my FrmMain, i have created a new object of this DatabaseManager

public partial class FrmMain : Form
{
    DatabaseManager dbm = new DatabaseManager();


And inside my form_load i have check the connection

if (this.dbm.GetDataConnection())
{
    MessageBox.Show("Connection Established");
}
else
{
    MessageBox.Show("Connection Failed");
}


Now, the problem is how do i validate the username and password entered in childLogin with my staff table inside my database..
AnswerRe: Database with MS Acess Pin
Paul Conrad27-Jul-08 5:45
professionalPaul Conrad27-Jul-08 5:45 
GeneralRe: Database with MS Acess Pin
benjamin yap27-Jul-08 6:02
benjamin yap27-Jul-08 6:02 
GeneralRe: Database with MS Acess Pin
Paul Conrad27-Jul-08 6:05
professionalPaul Conrad27-Jul-08 6:05 
GeneralRe: Database with MS Acess Pin
benjamin yap27-Jul-08 6:07
benjamin yap27-Jul-08 6:07 
GeneralRe: Database with MS Acess Pin
Paul Conrad27-Jul-08 6:10
professionalPaul Conrad27-Jul-08 6:10 
GeneralRe: Database with MS Acess Pin
benjamin yap27-Jul-08 6:12
benjamin yap27-Jul-08 6:12 
GeneralRe: Database with MS Acess Pin
Paul Conrad27-Jul-08 6:22
professionalPaul Conrad27-Jul-08 6:22 
Questionread Priv1.edb Pin
mohammadser27-Jul-08 4:30
mohammadser27-Jul-08 4:30 
AnswerRe: read Priv1.edb Pin
DaveyM6927-Jul-08 5:05
professionalDaveyM6927-Jul-08 5:05 
Questionstring.writeline format Pin
George_George27-Jul-08 3:59
George_George27-Jul-08 3:59 
AnswerRe: string.writeline format Pin
User 665827-Jul-08 4:27
User 665827-Jul-08 4:27 
GeneralRe: string.writeline format Pin
George_George27-Jul-08 16:45
George_George27-Jul-08 16:45 
QuestionToolBox Icon - VS2008 Pin
DaveyM6927-Jul-08 3:52
professionalDaveyM6927-Jul-08 3:52 
GeneralRe: ToolBox Icon - VS2008 Pin
DaveyM6928-Jul-08 0:21
professionalDaveyM6928-Jul-08 0:21 
Questionaccessing hardware information Pin
Seyyed Hossein Hasan Pour27-Jul-08 2:18
Seyyed Hossein Hasan Pour27-Jul-08 2:18 
AnswerRe: accessing hardware information Pin
half-life27-Jul-08 5:58
half-life27-Jul-08 5:58 
QuestionConvert Mp3 to Wave Files Pin
SHINOJK27-Jul-08 1:25
SHINOJK27-Jul-08 1:25 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.