Click here to Skip to main content
15,904,817 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
ObjInvoice.PaymentMode = ?
If I use function
C#
public DataSet GetPaymentMode(string CompanyId)
        {

            OleDbCommand cmdPermission = new OleDbCommand();
            if (Conn.State != ConnectionState.Open)
            {
                Conn.Open();
            }
            DataSet ds = new DataSet();
            cmdPermission.CommandText = "SELECT PaymentTerm from Company_Master where CompanyID=" + CompanyId + "";
            cmdPermission.CommandType = CommandType.Text;
            cmdPermission.Connection = Conn;
            cmdPermission.ExecuteNonQuery();
            OleDbDataAdapter adap = new OleDbDataAdapter(cmdPermission);
            if (Conn.State == ConnectionState.Open)
            {
                Conn.Close();
            }
            //adap.Fill(ds);
            return ds;
        }
Posted
Updated 23-Jul-13 20:54pm
v2
Comments
ridoy 24-Jul-13 2:54am    
so what is the problem here?!
Ashutosh_jha 24-Jul-13 3:04am    
sir i can't decide what i write on place of '?' ObjInvoice.PaymentMode = ?
Ashutosh_jha 24-Jul-13 3:04am    
i use this but get error
ObjInvoice.GetPaymentMode(ddlCompany.SelectedValue.ToString());
vimal_2010 24-Jul-13 3:26am    
What is the error you are getting?
Ashutosh_jha 24-Jul-13 4:24am    
pass value system.data.dataset

1 solution

Well looks like the question is incomplete Ashutosh.
Are you trying to access GetPaymentMode method and trying to fill that value into the ObjInvoice.PaymentMode in that case instead of the dataset as return parameter of your method GetPaymentMode you should traverse the dataset and return the value of whatever type the ObjInvoice.PaymentMode field is.
 
Share this answer
 
Comments
Ashutosh_jha 24-Jul-13 3:45am    
PaymentMode is string type
Kumar Prateek 24-Jul-13 7:44am    
In that case you instead of return DataSet as the return parameter from the function you can return the string value.
ds.Tables[0].Columns[0].ToString();

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