473,239 Members | 1,815 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,239 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 2169
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Sky | last post by:
Hello: I've been looking around for a way to create an IHttpHandler for webmethods...something that doesn't need a physical *.asmx page to be installed. So far I've found no quick and dirty...
3
by: sachinx | last post by:
I am calling following Powerpoint method expression.AddPlaceholder(Type, Left, Top, Width, Height) Here Left Top Width Height are optional parameters with Type as float How to call this method...
44
by: gregory.petrosyan | last post by:
Hello everybody! I have little problem: class A: def __init__(self, n): self.data = n def f(self, x = ????) print x All I want is to make self.data the default argument for self.f(). (I
5
by: Martin P. Hellwig | last post by:
While I was reading PEP 8 I came across this part: """ Function and method arguments Always use 'self' for the first argument to instance methods. Always use 'cls' for the first argument to...
2
by: Charlie | last post by:
Hi: I'm using the ObjectDataSource control to databind a Repeater. The method on business object that ObjectDataSource control point to takes as a parameter an instance of the...
1
by: emdzej | last post by:
Hi everyone, I've got short question, but not so obvious to answer I think. Is it possible to programically dump local variables and method arguments? It would be very helpfull for sending bug...
8
by: David Veeneman | last post by:
Should a member variable be passed to a private method in the same class as a method argument, or should the method simply call the member variable? For years, I have passed member variables to...
0
by: RSS5000 | last post by:
Here is the kind of method signature one of my methods have in my C# .net class. int MethodX (ClassXYZ obj) I am exposing my C# library to COM using comvisible property, defining interfaces...
1
by: Jeroen | last post by:
For a hobby project, I'm discovering the "undo/redo"- and "Command objects"- design patterns. In my specific project, I want: 1. The command objects to just hold the data; and 2. The...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 3 Jan 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). For other local times, please check World Time Buddy In...
0
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
0
Git
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...

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.