471,356 Members | 1,665 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,356 software developers and data experts.

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

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
3 2098
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
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
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.

Similar topics

3 posts views Thread by sachinx | last post: by
44 posts views Thread by gregory.petrosyan | last post: by
5 posts views Thread by Martin P. Hellwig | last post: by
1 post views Thread by emdzej | last post: by
8 posts views Thread by David Veeneman | last post: by
reply views Thread by XIAOLAOHU | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.