title: Update database method in .net
body: <p>I'm trying to update the database using a method were the parameters of the method will be used rather then using an SQL statement. I did this so a user can enter information into the database.</p>
  
  <pre><code>System.Data.OleDb.OleDbConnection con;
  DataSet dsl;
  System.Data.OleDb.OleDbDataAdapter da;
  
  public String updateDatabase(int id, String Fname, String Lname, int age, string job)
  {
      con = new System.Data.OleDb.OleDbConnection();
      con.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\\Users\\Owner\\Documents\\CIS3052.mdb";
      dsl = new DataSet();
  
      da = new System.Data.OleDb.OleDbDataAdapter();
  
      con.Open();
  
      DataRow dRow = dsl.Tables["Employee"].NewRow();
      dRow["ID"] = id;
      dRow["Fname"] = Fname;
      dRow["Lname"] = Lname;
      dRow["Age"] = age;
      dRow["Job"] = job;
      dsl.Tables["Employee"].Rows.Add(dRow);
  
      da.Update(dsl, "Employee");
      return null;
  }
  </code></pre>
  
  <p>The problem I have is in this line:</p>
  
  <pre><code>DataRow dRow = dsl.Tables["Employee"].NewRow();
  </code></pre>
  
  <p>It is telling me:</p>
  
  <blockquote>
    <p>Object reference not set to an instance of an object.</p>
  </blockquote>
  
  <p>I tried using <code>da.Fill()</code> but I cannot find a way to use that without using a SQL statement.</p>
  
  <p>Thanks.</p>