Calling a stored procedure from Entity Framework
I have one stored proc in my Entity Framework data model.The sproc shows in my model browser under stored procedures. I am not able to call my sproc from .net 4.0. I get syntax errors. What am I...
View Articleusing connectionString for ado.net
Hi, I am stuck. I have spent nearly a day to solve but to no avail. PROBLEM: Connecting to production database using entity framework. I connect fine on development. <add...
View ArticleDatabase account in code only EF Dbcontext creation
I have just begun to look at the Code only EF with Dbcontext creation. The Dbcontext constructor will need a string parameter to create an instance. My question is that since the EF will create...
View ArticleSplit results from DB into "chunks" of 10...
Afternoon, I need a hand to split over 1200 results into "chunks" of 10 so i can process these results with the Amazon MWS API. Can anyone provide any guidance on how i would go about doing this please?
View ArticleProblem with LINQ / Double type
var mySum = (from q in db.QUOTEs where q.STATUS.Equals("P") select q.FEE ).Sum(); foreach (var i in mySum) { LabelTotalFee.Text = String.Format("{0:C}", i.FEE); } THE ERROR:"foreach statement cannot...
View ArticleUsing SelectMany to Flatten IQueryable with Nested Objects
I have a LINQ statement that functions correctly, but when I try to export the List<T> to CSV/XLS file, I need to have it flattened so I can traverse through the List<T> and display the...
View ArticleGridView row updating using LINQ to SQL doesn't work
I have GridView that is filled with LINQ to SQL source. Here is the code protected void FillGridView() { DataClassesDataContext dContext = new DataClassesDataContext(); Guid...
View ArticlenHibernate Session.Query returns 0
Hello frnds, I am tring to get all records of table in List . Using NHibernate and Linq . I am not getting any run time error or compile time error . But Result count in List is 0 . Here is my code -...
View Articleupdate performance for bulk database updation
Hi all, i have one web application in asp.net 3.5 having one datagrid(asp.net1.1 control) on page. on page i have 10 dropdown and normal columns is present on grid.now i want to clooect all data from...
View ArticleDataSourceControl FILTERING
I am using the EntityFramework DataSourceControl. Obviously this control has a where property. And when you click on the ellipses you get the expression builder. I am having difficulty using filters in...
View ArticleImporting System.Data.Linq
This isn't working in Visual Studio. I've added the reference and done everything as I should have. The website and LINQ all still works perfectly fine when run under IIS, but it won't compile in...
View ArticleMultiple DbContext with independent transactions
I am currently using EntityFramework 4.3.1 with CodeFirst. I need to be able to handle working with multiple DbContext objects and manage the transactions manually. Each DbContext deals with it's own...
View ArticleCombo box fill using LINQ
Hi, I am stuck with the function that returns the results from a LINQ2SQL stored procedure. This function will be used as a combo box data source to fill it. Any suggestions. public...
View ArticleWhat is the error in function to export data from excel to dataset?
I have a function to export data from excel to Dataset which is as follows, public DataSet GetDataFromExcel(string filePath) { string strConn; strConn = "Provider=Microsoft.Jet.OLEDB.4.0;" + "Data...
View ArticleClause of related table
I'm still trying to wrap my head around LINQ, EF, MVC3. I have a basic structure like this (Entities) Employee -> EmployeeStatus -> Team The above are the tables (Entities) I'm currently...
View Articleproblem with query
Hi, I want to show ID from the table tbl_Payments. I was trying this code but returns tbl_Payments.PaymentTypeID . /**Show credit cards**/ // Update these variables to values whatever you are storing...
View ArticleMultiView form insert into multiple tables..
Hello all, I have a registration page using MultiView with 2 Views.. View1 goes to the table called dbo.Emp and View2 to multiple tables. However, here is the complications.I successfully passed View...
View ArticleClass statement reference
I want to write a class statement like the one below. It does not have any reference to db.mdf so there is an error in Me.Products. I have dragged the "Products" table into a dbml if that helps...
View ArticleQRY returning error if value is blank?
Hi, I am running the below expression to compare the diffence of 2 dates. If both dates are in the cell I would like it to return a 0 but if Date2 is blank I would like the difference to show. Right...
View ArticleStored Procedure sql parameter
Hello I have a Stored Proc for the Registration Page, but I need ADO.NET to take values from various textboxes.However, I'm recieving errors- Here is my code- public void InsertInfo() { String empdb =...
View Article