.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Unable to Create Object Variable for Linq Data Class

Posted By:      Posted Date: September 23, 2010    Points: 0   Category :ASP.Net

For some unknown reason I suddenly am unable to create an object variable for a Linq Data Class. If I create a new project and try the process again with the same database everything works as advertized.

The code I am using is Dim db As New RoggDataContext  which gives me an error on the object variable "db": Overload resolution failed because no accessibility 'NEW'  accepts this number of arguments.

I have looked inside every file in the Web Project like the web config to check the connection string, gobal, and designer.vb looking for any errors whit no JOY.  I also tried to create a new form and code behind with a button and received the same error.

This is mind blowing because as I already stated, I can create a new Web Site and the problem goes away.

Any help is appreciated!



View Complete Post

More Related Resource Links

Urgent How to Create it ,Object Data Source ,Linq and sql or other any way


my query is



my data is

HR    HR    Rec    Records    Leave    Leave Records    HRL.0001    Policy and Process for leave record.    27.06.2010    30.06.2010    WIP    Edlink
HR    HR    Rec    Records    Leave    Leave Records    HRL.0002    Quarterly Review    01.07.2010    04.07.2010    Planned    Edlink
HR    HR    DB    Database    SAL    Salary    DDS.0001    Calculation of Monthly salary    08.08.2010    09.08.2010    WIP    Edlink
HR    HR    Rec    Records    Ind    Induction Records    HRI.0001    Completion of dossiers.    08.07.2010    10.07.2010  

Building a Custom Data Grid: Performing Ad Hoc Web Reporting with a VBScript 5.0 Class Object


A flexible, customizable grid for displaying data is a useful tool for ASP developers. It allows Web visitors to customize their view of your data. This article takes the data grid presented in "Ad Hoc Web Reporting with ADO 2.0" by John Papa and Charles Caison (MIND, December 1998) and adds handy features such as a finds feature that supports multiple finds and a mode for adding and editing records. This version also improves response time by allowing asynchronous record download and it componentizes the code so it can be used as a standalone VBScript class object that can be reused in other pages.

Randall Kindig

MSDN Magazine July 2000

send data in class object from one page to another using session


hello everybody

now i hav stored all data like user name, data fatched from database of that user

and i stored that data and user name such as:

string strUserName="user name"

dataset ds =new dataset();// data of that user

now i wan yo send d whole data from my login page to user profile page

can anybody help me for that...................

and plz tell me that how much is this way is benifitial to send data from one page to another page

plz........kindly waiting for positive rply

Quick Note: Create Silverlight Graphs with SharePoint 2010 Data by Using LINQ

In this exercise, you will learn how to create Silverlight applications to retrieve SharePoint 2010 list data using LINQ.

Unable to create instance of proxy class in WCF

Hello, I created proxy class using svcutil.exe and added it in App_Webreference folder. I want to access objects and methods from this proxy. But I am unable to create instance of this proxy class. In inellisence, it is not showing this proxy class. What could be the problem ? I am using VS 2008 and Visual Basic.   Thanks in advance.  Amit Lohakare

Calling a method with a class object as parameter data type.

   [WebMethod]    public string GetInfo(Customer inCust)    {        // Code in here    } I have a web service that resides on a remote server. I want to call a public method of theweb service named  "GetInfo". The method is shown above. The web service method expects a class object oftype "Customer". What I did to create a Customer object was to define in my asp.net project my own class named "Customer" which is exactlythe same as the class that belongs to the web service project on the remote server. I then created an instance of Customerand tried to call the web service passing in an object of type customer : my.Service ws = new my.Service(); // Get web service connectionCustomer aCustomer = new Customer();aCustomer.Initialize();ws.GetInfo(aCustomer) // call web service passing in a Customer object The problem is that the compiler gives me the following error: Value of type '_Default.Customer' cannot be converted to 'ws.Class1'. Here Default is refering to my Default.aspx.cs code. Why is this? Do I need to Cast my "aCustomer" class object to a type ofws.Customer ? How do I do that?

Can I use class members for data or do I need to use Variable?

I have a class derived from CodeActivity that creates some objects in its constructor which will be used by Execute. These objects are exposed as properties so I can fake them for unit tests. In a code review a colleague suggested that I might need to make all of those objects Variable<T> "for them to play nicely in WF (with all the threading etc. going on)", but wasn't sure on that. Do I need to make these Variable<T>? If not, when would I want to use Variable<T> in a CodeActivity?

How to make linq Object Serializable... 'System.Data.EnumerableRowCollection is not marked as Seriz


Dear All,

Is it possible to make the linq object as serializable. I need to pass the serialized Data as parameter to the Remoting Method.

My LinQ Query is as follows

 Dim LinqQuery = From R In dsEdit.Tables(0) _

                    Where R.Field(Of Integer)("ID") < 400 _

                    Select R


The Definition of ZipObject is as follows.



  Public Function ZipObject(ByVal obj As Object) As Byte()

        Dim ms

how to create class and acess member using object

hi i am a new user to C# .net can any body help me to write a new class in c# AND HOW TO ACESS methods and members using its object thnks in advance

How to update value directly in class Object using Linq



I have a class object which is basically kind of hierarchy and looks like this when I convert that to XML.


  	<SKU>SKU 1</SKU> 
	<ConfigurationStatus>Not Configurable</ConfigurationStatus> 
  			<SKU>SKU 2</SKU> 
  			<ConfigurationStatus>Not Configurable</ConfigurationStatus> 
  					<SKU>SKU 3</SKU> 
		  			<ConfigurationStatus>Not Configurable</ConfigurationStatus> 



So you can see that I have "objectComponent" which is kind of hierarchy and that hierarchy can be upto any level.

Now I need to update <quantity> value where <sk

Problem with adding custom propety to a data class using Linq.



I tried to add a custom property to the data model:

public partial class Department
        public string ExtensionIdName
                return Extension.ExtensionName;

It seems that it works, but when I bind the data to a ListView it shows all the properties except the property I added manualy (ExtensionIdName).

Am I missing something or is there something wrong?

Unable to cast object of type 'System.Data.SqlClient.SqlCommand' to type 'System.IConvertible'.


















Can I Assign class object to session variable?


Hi all, i have a class Emp and whether it is possible to save the object of this class in a session?

And after creating the session with object how can i store it in state service and how can i use the object from session??

thanks in advance...

Data transformation: Sharing object/variable scope between form and dialog (VS2010/VB)


I am writing a class to provide data transformation between two databases with different schema, and have a windows form which tries to do the data translation work, and a modal showDialog which pops up to halt and tweak the process when errors are detected.

The dialog needs to share, tweak, and pass control information to the main form to tweak the transform parameters until everything works OK.  My question is how to best achieve the data sharing since the dialog has separate data scope.  I have been using declarations like the folllowing to successfuly share data and avoid creating public variables:

     Friend importStatusMessage as string

But with all the variables the dialog needs to tweak, it's becoming messy.  Is there any way to declare the entire dialog as 'Friend' so that main form data is in scope to the dialog?  Or, maybe create an object with properties to pass the data, and share only the object?



Video: Create Silverlight Graphs with SharePoint 2010 Data by Using LINQ

Learn to create a Microsoft Silverlight application that retrieves SharePoint 2010 list data by using LINQ and then displays that data in graphs.

Unable to cast object of type 'System.Data.DataSet' to type 'DataSet'.

Specifications : VS 2008 & SQL 2005 Express
Unable to cast object of type 'System.Data.DataSet' to type 'DataSet'.
I'm getting this error in cliend app, while passing values to the wcf service(iis),
WCF Sevice code
  public DataSet ListofAccounts(string custidno)
    SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["ConStrWestSideBank"].ConnectionString);
    SqlDataAdapter da = new SqlDataAdapter("select * from AccountDetails where vCustIdentityNo ='" + custidno + "'", con);
    DataSet ds = new DataSet();
    da.Fill(ds, "AccountDetails");
    return ds;
I'm unable to get this, i tried in many ways but no use, please help me. Follwing is the code,of button click event 
   ServiceReference1.ServiceClient svcobj = new

How to create an object of a class in .NET DLL from ASP code in Visual Interdev?

I have a .NET DLL which I want to refer in ASP code (in Visual Interdev 6.0). I have registered the DLL using RegAsm.exe and the DLL class library is getting properly registered. But I am unable to create an object of the public class of the DLL from Visual Interdev. Neither am I able to see the DLL in the reference box. How do I use the .NET DLL in ASP?
Thanks & Regards, Kaushik Ganguli, MCTS (ASP.net, SQL Server)
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend