Click here to Skip to main content
15,945,603 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hii
i m generating code dynamically using CodeDom.can any one tell me how i can write SQL query in a forloop in CodeDom.
i woul like to generate code like this using codedom

C#
DataAccess.selectQuery(DatabaseDs, "SELECT Claim_No ,SSN from Claims_Account", "Claims_Account");
                   for (int i = 0; i < DatabaseDs.Tables["Claims_Account"].Rows.Count - 1; i++)
                       for (int j = i; j < DatabaseDs.Tables["Claims_Account"].Columns.Count; j++)
                       {
                           mylocation = DatabaseDs.Tables["Claims_Account"].Rows[0]["Claim_No"].ToString();
                           strtest = DatabaseDs.Tables["Claims_Account"].Rows[0]["SSN"].ToString();
                       }
                   input_text = strtest.ToString();


thanks in advance
Posted
Comments
Sergey Alexandrovich Kryukov 13-Apr-11 4:03am    
In CodeDOM?! Are you sure? What's the idea? Don't you miss something?
--SA
dooa 13-Apr-11 4:23am    
ohhh i mean to say that using CodeDom i would like generate source code of SQl query.
Sandeep Mewara 13-Apr-11 5:13am    
Still not clear on what you got and what is stopping you.
dooa 13-Apr-11 5:55am    
ok i will explain u.
i create a dynamic class using CodeDom..now i want to embed Query which will execute untill the loop end..this select query extract values from SQL table...

soo can u tell me just that how to generate source Code for query using CodeDom..

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900