HI Dinesh,
You just given the classes. You didn't give actual work the
functions do. Can you tell me how i can do in C.
Regards,
Bhaskar.
Dinesh Behl wrote:
>
> Hi Bhaskar,
>
> I wrote the code to store the result of SELECT query.....
>
> I treated the resultset as a table where each cell is the column value and
> row is set of cells, and table is set of rows.
>
>
> Below is the snippet of the class structure. You can modify it as per ur
> requirement.
>
> Hope it helps.
>
> Dinesh
>
> class SwCell
>
> {
>
> private:
>
> string m_strName;
>
> string m_strValue;
>
> string m_strType;
>
> public :
>
> string getName();
>
> string getValue();
>
> int getType();
>
> void setType(int type);
>
> void setName(string name);
>
> void setValue(string value);
>
> };
>
> class SwRow {
>
> vector<SwCell> m_Row;
>
> public:
>
> void addCell(SwCell val);
>
> void addCell(vector<SwCell> cells);
>
> SWDBI_API SwCell getCell(int index);
>
> SWDBI_API SwCell getCell(string cellName);
>
> SWDBI_API int size();
>
> SWDBI_API vector<SwCell> getRow();
>
> };
>
> class SwRowset
>
> {
>
> vector<SwRow> m_Rowset;
>
> public:
>
> void addRow(SwRow val);
>
> SWDBI_API SwRow getRow(int index);
>
> SWDBI_API int size();
>
> };
>
>
> On Fri, Jan 20, 2012 at 2:52 AM, bhaskarReddy <[email protected]> wrote:
>
>>
>> Hi Friends,
>>
>> How to store the values of a columns in to the appropriate
>> variables.
>>
>> struct ABC
>> {
>> int a;
>> int b;
>> char *str;
>> };
>>
>> a b name
>> 1 2 ABCD
>> 2 4 WXYZ
>>
>>
>> Now i am taking a variable to a structure, and i want to load the
>> column
>> values of a particular row.
>>
>> ex: struct ABC st;
>>
>> st.a = //store the record 1's 'a' value.
>> st.b = // store the record 1's 'b' value.
>> st.str = // store the record 1's 'name' value.
>>
>> Regards,
>> Bhaskar Reddy.
>> --
>> View this message in context:
>> http://old.nabble.com/how-to-restore-the-column-values-into-the-structure.-tp33172778p33172778.html
>> Sent from the SQLite mailing list archive at Nabble.com.
>>
>> _______________________________________________
>> sqlite-users mailing list
>> [email protected]
>> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>>
> _______________________________________________
> sqlite-users mailing list
> [email protected]
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>
>
--
View this message in context:
http://old.nabble.com/how-to-restore-the-column-values-into-the-structure.-tp33172778p33186337.html
Sent from the SQLite mailing list archive at Nabble.com.
_______________________________________________
sqlite-users mailing list
[email protected]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users