tcmgc

tcmgc

  • NA
  • 4
  • 0

SqlDataAdapter problem with a strong typed DataSet.

Dec 21 2005 1:09 PM
I tried to return a strong typed DataSet from a remote server to a windows form application using a SqlDataAdapter.  It did not retieve any records.  When I use the same code and return a DataSet it works.  Could anyone tell me what I'm doing wrong?

When I use the same code in a Web Service, I was able to create a strong typed DataSet.  But I can't use this because my client wants a remote server.

Here is the code:

public DsProject GetProject()
{
    DsProject ds =
null;
    try
    {
        ds =
new DsProject();
        SqlDataAdapter da =
new SqlDataAdapter(this.ProjectSelCmd);
        da.Fill(ds);
    }
    catch(Exception ex)
    {
        ds =
null;
        throw(ex);
    }
    return(ds);
}

public DataSet GetProject2()
{
    DataSet ds =
null;
    try
    {
        ds =
new DataSet();
        SqlDataAdapter da =
new SqlDataAdapter(this.ProjectSelCmd);
        da.Fill(ds);
    }
    catch(Exception ex)
    {
        ds =
null;
        throw(ex);
    }
    return(ds);
}