Click here to Skip to main content
15,895,656 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi All,
I am using C# windows base program and database is MS Access.I have to get a value which data type is Currency but I m not able to retrieve the data from the table
below I given the code--
private void calc()
        {
            double price;
            string str;
      //here I m suppose to get the particular "unitprice" data which is Currency type
            str = "Select unitprice from partmaster where partnumber=" + cmbPartNo.SelectedItem.ToString();
            OleDbCommand cmd = new OleDbCommand(str,con);
            OleDbDataAdapter da = new OleDbDataAdapter();
            da.SelectCommand = cmd;
}

Thanks to All
Posted
Updated 1-Aug-11 19:59pm
v2
Comments
Toniyo Jackson 2-Aug-11 2:01am    
What is the datatype of partnumber in database?
IndrajitDasgupat 2-Aug-11 2:14am    
partnumber type is number for me the problem is unitprice which type is currency and I want to store it in a variable so further I can go for other calculation with this

1 solution

Hello Indrajit,

I like to suggest you please go through with
Click here[^] this before any furthur development. trust me you'll not require help on this after understanding the topic.
try to learn from the link.

thanks
sanjeev
if any doubt let me know.
 
Share this answer
 

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