CRUD on Entity Framewok
I want to do crud operations on entititiy objects using a Gridviews events,.. Row Updating event, Row Deleting event etc, Thanks !!!
View ArticleHow to perform outer join in entity framework
How can I perform a left outer join on two tables using entity framework? Below I can easily perform an inner join. Yet I have not a clue how to perform an outer join? IEnumerable<TheList>...
View ArticleWhy we do not have CommandType.UserDefinedFunction in ADO.NET?
Hi, Please can anybody have any idea why there is no CommandType.UserDefinedFunction in ADO.Net, though UDF's can be executed in other ways from .NET that is from SP or text. Thanks Vikas Khanna
View ArticleGridview disappears on paging
I thought I would be worth a try to ask this one more time. Especially since my understanding of what is causing the problem has increased. Although I still dont have the solution. I am using the code...
View ArticleDisplay all records before filtering from dropdown menu
I have a EntityDataSource object connected to a data source that displays all the records in a table when viewed in a browser. When I add a dropdownlist to the page and use the QueryExtender to connect...
View ArticleHow do I delete in entity framework, and also perform a rollback in case of a...
Using entity framework, I need to delete records from a single table based upon a unique column Id. I have alot of data which I need to update in a single database table. Really it makes more sense for...
View ArticleSum of values of datatable columns.
Hi Experts,Which is the best way to get sum of values in columns of a datatable, other than looping by each row? I need to get like this.. color men women red 10 15...
View ArticleConnecting to a new connection string using entity framework dynamically.
Hi all, Does anyone knows how to connect to a new database connection for every user using entity framework? I've a one database whcih authenticates all the users to my application. After...
View ArticleCompare a database field to today's date
var qryProjectsDueToday = from p in db.projects where p.need_date = ????? (I want today''s date) orderby p.project_id descending select p; it doesn't like anything I try to put in there! How do I...
View ArticleSave only that field change (Code First)
Hi Please help. me, I have a MVC 3 application, this is the scenario Model Public Class Person { public string PersonID { get; set; } public string LastName { get; set; } public string FirstName { get;...
View ArticleSql to Linq - Is this possible?
I'm trying to convert this sql to a linq query: select SystemReleases.SystemReleasesID, SystemReleases.ReleaseTitle, SystemReleases.Created, SystemReleases.CreatedBy, statuss.ReleaseStageValue from...
View ArticleDate comparison using dynamic linq
I have a generic method which takes the query (where clause) as string e.g. user.AsQueryable().Where( " UserName == \"xx\" AND Age = 12 " ); When i add datetime value to it the method fails. It...
View ArticleCombine multiple column into one column
Hi, I am trying to display multiple column into single column as below: Name1 | Address1 Name2 | Address2 Name3 | Address3 Result: Name1 Address1 Name2 Address2 Name3 Address3 Any idea?
View ArticleLinq to SQL query and SQL query return diffrent results
I try the same SQL question on two diffrent ways and I get diffrent results.The first way is SQL view in Visual Studio SELECT DISTINCT ruleValueFROM rulesWHERE (ruleValue LIKE '%ORG%') and the second...
View ArticleNullReference Error in data acces
Hello, I'm trying to solve this problem for days but I can't figure out where i'm going wrong. I have written two classes to retrieve data from a SQL Server database; ContentDB.vb and...
View ArticleLinked Server in SQL Server 2008?
How can you connect to a linked Server in SQL Server 2008? I am able to connect to a SQLite and SQL Server database but in this instance I need to be able to connect to a Linked Server. Is there any...
View ArticleInsert values into two tables with identity
Hi all, I looked around the net for an example but I am not getting much. What I need to do is insert into two different tables in my 2008 SQL databse. Insert 1 will save data into table #1 using...
View ArticleAny way to set pluralization for a single table in Linq?
This is getting kind of irritating. I have a table named "Status". Every time I make a change to the dbml, I have to also go into the .designer.cs and make sure I manually update the name of the...
View ArticleEF Code First generating duplicate index names for base class
PREFACE: I think this is a bug in the EF code base but I'm open to suggestions for a change in my model as well. The Error: When EF Code First attempts to build my model, I get the exception: The...
View ArticleEF: Invalid object name 'dbo.Users'
Hi guys. I'm having some trouble using the Entity Framework and was hoping someone has seen this. I've been all over Google, but nothing has worked. I feel like it must be some kind of configuration...
View Article