By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,894 Members | 1,110 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,894 IT Pros & Developers. It's quick & easy.

No overload for method 'GetDataByClassType'takes '1' arguments

P: n/a
Can you help me please,
I have this error message

"No overload for method 'GetDataByClassType'takes '1' arguments"

private void button7_Click(object sender, EventArgs e)
{
string connString = @"Data Source=.;Initial
Catalog=Northwind;Integrated Security=True";
DataClasses1DataContext dc = new
DataClasses1DataContext(connString);
Table<Customercustom = dc.Customers;

// *****This row is wrong,
dataGridView1.DataSource =
GetDataByClassType<Customer>(custom)();
//No overload for method 'GetDataByClassType'takes
'1' arguments
}

public List<TGetDataByClassType<T>() where T : class
{
string connString = @"Data Source=MUSTAFAC;Initial
Catalog=Northwind;Integrated Security=True";
DataClasses1DataContext dc = new
DataClasses1DataContext(connString);
return Enumerable.ToList<T>(dc.GetTable<T>());
}
Jul 14 '08 #1
Share this Question
Share on Google+
3 Replies


P: n/a
Hi Mucahit,

You have no arguments for the method GetDataByClassType<T>() but provide
the value 'custom' instead. Either add the argument to the arguments list
'public List<TGetDataByClassType<T>(T t) where T : class' or remove 'custom'
from calling
'GetDataByClassType<Customer>()()'. Depends

Regards, Alex Meleta
mailto:am*****@gmail.com; blog:devkids.blogspot.com
Jul 14 '08 #2

P: n/a
Thanks for answer Alex,
But how can i this method ,

your script block give me error,

plaese , send me code block for this method,

"Alex Meleta" <am*****@gmail.comwrote in message
news:df*************************@news.microsoft.co m...
Hi Mucahit,

You have no arguments for the method GetDataByClassType<T>() but provide
the value 'custom' instead. Either add the argument to the arguments list
'public List<TGetDataByClassType<T>(T t) where T : class' or remove
'custom' from calling 'GetDataByClassType<Customer>()()'. Depends

Regards, Alex Meleta
mailto:am*****@gmail.com; blog:devkids.blogspot.com


Jul 14 '08 #3

P: n/a
Hi Mucahit,

Which one? I gave you both. Actually your method GetDataByClassType<T>()
doesn't have an arguments but you try to provide custom. As example solution:

dataGridView1.DataSource = GetDataByClassType<Customer>();

Regards, Alex Meleta
mailto:am*****@gmail.com; blog:devkids.blogspot.com
Jul 15 '08 #4

This discussion thread is closed

Replies have been disabled for this discussion.