Non-invocable member 'System.Windows.Forms.Control.DataBindings' cannot be used like a method?

Posted by Sudheep.grandhe under C# on 11/9/2011 | Points: 10 | Views : 3795 | Status : [Member] | Replies : 4
Hi,

In my coding cmb_particulars.databindings shows instead of cmb_particulars.databind();.currently iam developing windows applications.please do the needful.

Error:-
Non-invocable member 'System.Windows.Forms.Control.DataBindings' cannot be used like a method.
cmb_particulars.DataBindings();

Best,
Sudheep.



Responses

Posted by: Blessyjees on: 11/9/2011 [Member] Bronze | Points: 25

Up
0
Down
Hi,

What is "cmb_particulars". is it combobox control. provide the code.

Blessy Baby
Digitalmesh Softech pvt Ltd
https://blessybaby.wordpress.com/

Sudheep.grandhe, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Sudheep.grandhe on: 11/9/2011 [Member] Starter | Points: 25

Up
0
Down
Hi,

public void bindgrid()
{
SqlConnection con = new SqlConnection("data source=mars-104;initial catalog=marsweb;integrated security=true");
con.Open();
string sql = "select * from tbl_temp";
SqlCommand cmd = new SqlCommand(sql, con);
SqlDataAdapter da = new SqlDataAdapter(cmd);
DataSet ds = new DataSet();
da.Fill(ds);
if (ds.Tables[0].Rows.Count > 0 && ds.Tables[0].Rows.Count > 0)
{
GridView1.DataSource = ds;

}
}

Best,
Sudheep.

Sudheep.grandhe, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Blessyjees on: 11/9/2011 [Member] Bronze | Points: 25

Up
0
Down
Hi,

I can't find any error in your code.

Blessy Baby
Digitalmesh Softech pvt Ltd
https://blessybaby.wordpress.com/

Sudheep.grandhe, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Sudheep.grandhe on: 11/9/2011 [Member] Starter | Points: 25

Up
0
Down
Hi,

I proudly said thanks to vuyiswamb.He was helpmed me a lot with the help of teamviewer he was resolve my queries.he done the good job in my case

Best,
Sudheep.

Sudheep.grandhe, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response