.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

can any one help me how to use asynchronous call from linq Entity to sql in WPF.

Posted By:      Posted Date: April 14, 2011    Points: 0   Category :JQuery
can any one help me how to use asynchronous call from linq Entity to sql.
 when i click search i am calling background worker, on the back ground worker
 i want to call asynchronous method with database(because in my database i have too much value)
i am using linq entity frame work.when i click cancel button asynchronous will should stop .
can any one help me

joby James

View Complete Post

More Related Resource Links

can any one help me how to use asynchronous call from linq Entity to sql.

can any one help me how to use asynchronous call from linq Entity to sql.
 when i click search i am calling background worker, on the back ground worker
 i want to call asynchronous method with database(because in my database i have too much value)
i am using linq entity frame work.when i click cancel button asynchronous will should stop .
can any one help me

joby James

SOA Data Access: Flexible Data Access With LINQ To SQL And The Entity Framework


Building a data access layer using LINQ to SQL and the ADO.NET Entity Framework allows you to decouple your application from the persistence technology you're using.

Anthony Sneed

MSDN Magazine December 2008

VS 2010: no Entity Framework or LINQ support for SQL Server 2000 SQLOLEDB connection?

Hello, I'm working with Visual Studio 2010 and for Data Connections am connecting to a SQL Server 2000 production database. When I try to drag a table to a .dbml file, the Object Relational Designer says, "The selected object(s) use an unsupported data provider."If I try to create an .edmx file via Generate from database, then the alert is, "This server version is not supported. You must have Microsoft SQL Server 2005 or later."So VS 2010 has no support for the Data Entity Framework or LINQ when connecting to a SQL Server 2000 database? If that is the case, what is the best data access strategy for this scenario?  

Asynchronous WCF call seems to be blocking

Hi all,I have a Silverlight application that calls a WCF web service which is hosted in an ASP.NET web application. On the client side I call two methods A and B on the service's interface asynchronously; each time a new proxy is created and used to call the respective method. Since the service has its InstanceContextMode set to PerCall, each call should create a new service instance and be independent from the others.For testing purposes I have added a Thread.Sleep(5000) to the implementation of method A.What I expect now is that when the client calls methods A and B one after the other, the service should process both calls in parallel and since method A has the call to Sleep(), method B should return first. Five seconds after that, method A should return as well.For the very first attempt in the web application's lifetime this works as expected, i.e. after rebuilding or performing an iisreset and calling those methods from the client side, it shows the expected behavior explained above. Here's a sample debug dump I received on the client:    Method B, 17:41:23, Server-Thread-ID: 9    Method A, 17:41:28, Server-Thread-ID: 8But after that, when I call those methods again (in exactly the same way), method A seems to block on the server:    Method A, 17:42:43, Server-Thread-ID: 1    Method B, 17:42:44, Serv

How to setup Query Result Shaping for LinQ to SQL instead of Entity Framework?

Hi, I am new to this, and I am trying to implement a linq query similar to db.Genres.Include("Albums") command from mvc music store using my current DB setup. I realize that the tutorial mentions Checlking the "Include foreign key columns in the method" when creating the tables in ADO.NET, but if I am using LINQ to SQL classes, then how can I obtain the same effect. And how do I use db.Genres.Include("Albums") to simplify my life? Thanks

Cancel asynchronous WCF call ?

In .NET 3.5, is it possible to cancel an asynchronous call to a WCF service ?   The desire is that a user search screen may fire a very long running SQL query in the middle tier, which they then want to cancel. The idea is that the actual database query gets cancelled, not just the WCF call to the middle-tier (otherwise the SQL query is still chewing up resources in the database). Is this possible ?   I'm using the event-based asynchronous pattern that was introduced for WCF in .NET 3.5, which Microsoft are now recommending to be used: http://msdn2.microsoft.com/en-us/library/ms734701.aspx e.g. Code Snippet ... //hook up Completed handler, and call service asynchronously. Use Tab|Tab to auto-generated in VS client.SomeMethodCompleted += new EventHandler<SomeMethodCompletedEventArgs>(client_SomeMethodCompleted); client.SomeMethodAsync(myParam); ...   //Asynchronous result - display in UI. //Completed event handler gets called on UI thread it was created from. void client_SomeMethodCompleted(object sender, SomeMethodCompletedEventArgs e) { //Do something with e.Result; }     Thanks, Andy.

When to use views and sp with linq entity framework?

Hi, When do I need (/ best practice) to use views and stored procedures in my database when using linq with the entity framework?Can you give me example scenario's? Thanks!

LINQ to Entity - using join for multiple table


I have my SQL query which needs to be conerted to Linq to Entity,

select pfr_sa.SID,pfr_sa.SourceGroupID,tx.txroll_cadaccountnumber,tx.txroll_StreetNumb

Entity Framework - how to join tables without LINQ and with only string?


Hi all,

I have a question about Entity Framework. Please answer if you know answer on this. I have such query :

    String queryRaw =
        "SELECT " +
        "p.ProductName AS ProductName " +
        "FROM ProductEntities.Products AS p " +
        "INNER JOIN CategoryEntities.Categories AS c " +
        "ON p.CategoryID = c.CategoryID ";
    ObjectQuery<DbDataRecord> query = new ObjectQuery<DbDataRecord>(queryRaw, entityContext);
    GridView1.DataSource = query;

Particularly I want to join few tables in one query, but I can NOT use LINQ and can NOT use ObjectQuery with objects mapped to DB fields inside my query. Because each entity creates dynamically. So this is what i can NOT use :



The question is can I use something like this instead of using objects?

query.Join ("INNER JOIN CategoryEntities.Category ON p.CategoryID = c.CategoryID ");

Is there a way to query entity based on multiple filter criteria? WCF Data Services, Linq to Entiti


Instead of:

DW_CMSOPEN dwc = new DW_CMSOPEN(new Uri("http://acctdev02/WCFDataService/EmployeeService.svc"));

dwc.Credentials = System.Net.CredentialCache.DefaultCredentials;

var employees = from emp in dwc.Employees 
             where emp.DEPT == "123"
             select emp;

I'd like the linq query to resemble:

var employees = from emp in dwc.Employees
              where emp.DEPT // in {"123", "456", etc}
              select emp;

Entity Framework vs LINQ to SQL


what is diffrence between

Entity Framework and LINQ to SQL

i cant yet find a good  blog on this

i have read that in LINQ to SQL only one to one mapping is possible

but Entity Framework allowes many , is it right? if so i dont understand this

asynchronous call for data population in user control


i have a user control in which i want  to populate a drop down on blur event of text box asynchronously.. i tried with page method but it gives error as method is undefined.. then i tried with writing a web service..
and called a web service method in javascript on user control.. this also gives the same error as method is undefined...project is using master pages.. so the script manager is registered in master page..
so i added service reference as

ScriptManager sm = ScriptManager.GetCurrent(this.Page);
            sm.Services.Add(new ServiceReference("../Controls/MeetingTime.asmx"));

in user control...

below is my javascript call..

function getMeetingTime()
       var uclcmbUserId = document.getElementById('<%= uclcmbActiveClients.ClientID %>'+'<%= uclcmbActiveClients.ActualComboId%>');       

Serialize the linq to sql entity



Please help in following error

Type 'System.Data.Linq.ChangeTracker+StandardChangeTracker' in Assembly 'System.Data.Linq, Version=, Culture=neutral, PublicKeyToken=b77a5c561934e089' is not marked as serializable

have read all threads but still cant solve the error.

I can do insert update and delete but dont know where exactly the error occurs and how??

How use sum in Entity Data Model with linq?



i have a database with 4 table aspnet_Users, Forum, Topic, Post thay are related:

aspnet_Users with Topic by UserId

Forum with Topic by ForumId

Topic with Post by TopicId

i created a linq to get data from Database like:

Dim db As New MelorinEntities()
        Dim Topics = From t In db.Topic _
                     Join u In db.aspnet_Users _
                     On t.UserId Equals u.UserId _
                     Where t.ForumId = _ForumId _
                     Select t.UserId, t.TopicId, t.Name, t.IsLock, t.NumberOfView, _


 now i need to get also how meny post are in a topic but i don't know how to write the querry

can you please help me?



How to call a Stored procedures with varchar output parameters in LINQ


I have a stored procedure with the following structure:

CREATE procedure EditFeriodigiesForm
@EditID int,
@producer varchar(50) output,
@IssuedDate datetime output,
@stadio varchar(50) output,
@Method varchar(50) output,
@Monades_N varchar(50) output,
@Monades_P varchar(50) output,
@Monades_K varchar(50) output,
@comments varchar(100) output,
@responsible varchar(50) output
Begin Try
	Begin tran
SELECT @IssuedDate=IssuedDate,@producer=ProducerID,@stadio=KalliergitikoStadio,@Method=Method,@Monades_N=Monades_N,@Monades_P=Monades_P,@Monades_K=Monades_K,@comments=Comments,@responsible=Responsible from ferti_odigies WHERE FertOdigiesID=@EditID
end try
	Begin catch
	if @@error>0
declare @ErrMsg varchar(4000),
		@ErrSeverity int
Select @ErrMsg=Error_Message(),

Raiserror(@ErrMsg ,@ErrSeverity,1)

end catch 

Now i need to call it in LINQ.I have done the mapping thing and the SPROC is ready to be called in my form.aspx.cs form, as following:
  int id = Edit_id;
            int? producer;
            DateTime date =Convert.ToDateTime(txtdate.Text);
            string stadio;
            string method="";
            string monadesn="";
            string monadesp="";
            string mo

which parameters should use to call linq stored procedur ?



I have JQgrid that it binds from linq using linq datasource,I want to know how can I  delete,edit,add button in JQGrid using Stored procedure.Actually I write stored procedures i just want to know what parameters pass to them and how?

here is my sp:

ALTER PROCEDURE dbo.AddStoredProcedure

@BookID int,
@MenuID int,
@Name nvarchar,
@regDate date,
@Author nvarchar,
@Publisher nvarchar,
@Price int,
@Description nvarchar,
@Status nvarchar
  Insert into Book(BookID,MenuID,[Name],RegDate,Author,Publisher,Price,Description,Status) VALUES (@BookID,@MenuID,@Name,@RegDate,@Author,@Publisher,@Price,@Description,@Status)
Delete sp

ALTER PROCEDURE dbo.DelStProcedure

  @BookID int
	AS Delete from Book where BookID=@BookID
Edit sp

ALTER PROCEDURE dbo.EditStoredProcedure

  @Name nvarchar,
  @BookID int
  UPDATE Book  SET [Name]=@Name WHERE BookID=@BookID


when i want to call these procedures i write this cod in c#:

 protected void JQGrid2_RowDeleting(object sender, Trirand.Web.UI.WebControls.JQGridRowDeleteEventArgs e)

        DataClassesDataContext dc = new DataClassesDa
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