Reputation: 2000
I am Working in asp.net and c#.
I have a partial class in my application.One of the methods of this class returns a value( value is a dataset) like return value;
example code:
public partial class CommonClass : IDisposable
{
public static dataset somemethod(string somevariable)
{
//some code
return variable;
}
}
Now i want to access the value of variable in my codebehind.How can i do that.please give some sugessions..
NOTE:variable is a dataset..
Upvotes: 2
Views: 578
Reputation: 148150
You can call the static method somemethod
of your class CommonClass
. You can read more about static and instance methods here.
DataSet ds = CommonClass.somemethod("somevalue");
Upvotes: 1
Reputation: 176934
just like this you can do it as method is static there is no need to create any instance of class you can call it as below
DataSet ds =CommonClass.somemethod("mydata") ;
Upvotes: 4