C1 Community
ComponentOne Community is a free source for developers and help authors to collaborate and communicate.

I need a help.. How binding C1WebDataSet direct on DB?

rated by 0 users
This post has 2 Replies | 2 Followers

Not Ranked
Posts 1
itsoft Posted: Wed, Mar 19 2008 5:55 AM

Hi~

I'm begginig Developer for asp.net.

 I have many problems.. so, ask for your help.

 please see the source

         SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString);
        SqlCommand cmd = new SqlCommand("select * from products",con);
        SqlDataAdapter ad = new SqlDataAdapter();
        ad.SelectCommand = cmd;
        DataSet ds = new DataSet();
        ad.Fill(ds);
 and..      

        C1WebDataSet.????= ds.Tables[0].Rows[0]["productid"] <---what i do??

and..

 

-- i will convert DataSet to C1WebDataSet like this source ... so what i do??

    public static void Bind( DataSet dSet, C1WebDataSet GDS )
    {
        GDS.addDataColumnsHeader(dSet.Tables[0]);
        GDS.addDataColumnEnd();
        foreach ( DataRow Row in dSet.Tables[0].Rows )
        {
            foreach ( DataColumn column in dSet.Tables[0].Columns )
            {
                GDS.addDataRowValue(column.ColumnName, Row[column.ColumnName]);
            }
            GDS.addDataRow();
        }
        GDS.end();
    }

 

-Pai

 

 

 

Top 10 Contributor
Posts 1,645
C1_AndreyD replied on Wed, Mar 19 2008 11:16 AM
Use the DataSet object instead of C1WebDataSet. Why do you want to
convert it to a C1WebDataSet? I don't see what are you trying to do.
Not Ranked
Posts 1
itsoft01 replied on Wed, Mar 19 2008 10:59 PM

dear Andrey 

thank you for your answer.

-Pai

 

 

Page 1 of 1 (3 items) | RSS
Contact ComponentOne: 1.800.858.2739 ©1987-2010 ComponentOne LLC All Rights Reserved.