473,396 Members | 1,827 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,396 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 2178
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...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.