Whenever I add a certain table to a DBML file via LINQ to SQL, I get 102 errors in my VB NET project.
Some of the errors:
Error 1 Attribute 'TableAttribute' cannot be applied multiple times. C:\Documents and Settings\zchoy\My Documents\Virtual EMS Deployment\Life And Death\Life And Death\ShearwaterEMS.designer.vb 74 2 EMS Rea...
To begin with, I LOVE LINQ TO SQL. It's so much easier to use than direct querying.
But, there's one great problem: it doesn't work well on high loaded requests. I have some actions in my ASP.NET MVC project, that are called hundreds times every minute.
I used to have LINQ to SQL there, but since the amount of requests is gigantic, LI...
I'm currently doing integration testing on a database and I have the following sql statement:
var date = DateTime.Parse("01-01-2010 20:30:00");
var result = datacontext.Repository<IObject>().Where(r => r.DateTime > date).First();
Assert.IsFalse(result.Finished);
I need to test if the results retrieved from the statement, where the giv...
I am using VS2010 and C#
When I map/select my database tables with LINQ to SQL I have to option to change the "member" propery, but when i delete the table (because I changed something in the schema for example) and add it again the member value gets "reset". Is it possible to set/override this member programmaticly, so that I dont have...
Hi guys
In the context of the n-tier application, is there a difference between what you would consider your data access classes to be and your repositories?
I tend to think yes but I just wanted to see what other thought. My thinking is that the job of the repository is just to contain and execute the raw query itself, where as the d...
I have a Batch Table that has three columns ID, Name, Type and a CustomAttribute table that has three columns ID, ParentID, PropertyName and Value.
The Select query is "Select Batch.ID, Batch.Name, CustomAttribute.PropertyName, CustomAttribute.Value from Batch, CustomAttribute where CustomAttribute.ParentID = Batch.ID
This query will g...
This is really confusing me. Here is a snippet of my model:
* SQL Server *
Event
-----
Id (int, PK) NOT NULL
Title (varchar(100)) NULL
LastModified (datetime) NULL
EventDates
----------
Id (int, PK) NOT NULL
StartDate (datetime) NULL
EndDate (datetime) NULL
* C# *
Event
-----
public int Id
public string Title
public DateTime LastM...
I have just updated to using EF 4.0 where before i was using Linq 2 SQL.
I have a query:
var UserList = this.repository.GetUsers();
return Json(UserList, JsonRequestBehavior.AllowGet);
This was generating an error: "A circular reference was detected while serializing an object of type"
This prompted this code which worked f...
I am having problems with deleting all records in a table with VB.NET. I am using this code to delete all records in the Contacts table
For Each contact In database.Contacts
database.Contacts.DeleteOnSubmit(contact)
Next
But I get this error
Can't perform Create, Update or Delete
operations on 'Table...
Hi,
I have a complex data structure, which I boiled down in a dbml file with one class and 6 one-to-many relations. This data must also be read via xml. The xml structure is something like:
<table id=1>
<column 1></column 1>
<column n></column n>
<m-n table x>
<column 1></column 1>
</m-n table x>
</table>
where t...
I have a MVC project that has a Linq to SQL dbml class. It is a table called Clients that houses client information. I can easily get the information to display in a View using the code I followed in Nerd Dinner but I have added a stored procedure to the dbml and it's result set is of IQueryable, not IQueryable. I need to convert IQue...
I have a DataContext object, called "CodeLookupAccessDataContext", that was generated through the Visual Studio LINQ to SQL class wizard. I extended the functionality of this object such that it exposes some methods to return results of LINQ to SQL queries. Here are the methods I have defined:
public List<CompositeSIDMap> lookupCompos...
How to write FirstOrDefault Linq Query in F#?
Can I use linq to sql in F# in totally?
...
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace Advanced_LinQ_Query
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
...
Ok the thing is that I am using asp.net mvc with linq to sql. I have a scenario where there are two tables group and features with many to many relationship with the third table groupfeatures. I have drag and drop all three table in the dbml file.
The thing is that it runs fine with group but when I call the Feature things the above err...
I created a simple Caching Data Access Layer that has caching using the Enterprise Library Caching Application Block and also makes use of SQL Query Notification - therefore not supporting any queries which are not valid for query notification.
Background: This was put in place after the application was developed in order to lighten the...
In my experience building web applications, I've always used a n-tier approach. A DAL that gets data from the db and populates the objects, and BLL that gets objects from the DAL and performs any business logic required on them, and the website that gets it's display data from the BLL.
I've recently started learning LINQ, and most of th...
I am having columns as category and songs in my table for each category. There are almost 10 songs and in total there are 7 categories such that it is tabled as
category1 songCategory1a
category1 songCategory1b
category1 songCategory1c
---
---
--
category2 songCategory2a
category2 songCategory2b
category2 songCategory2c
---
---
---
cate...
I am working on a new project and hoping to use LINQ to SQL for the data
access but have come across the following issue.
I need to have my application access 3 databases with similar but not
the same table structure, for example
Database1 and Database 2 has a table called tblCustomer with 2 columns
CustomerKey and CustomerName
Databa...
I want to create a checkboxes hierarchy like this in mvc2.How would I be able to achieve this in the most simplest manner.I have done this with tree in traditional forms .Beside Each field there is a checkbox. If I want to Assign Manage User and Manage Feature to the Administrator I will checked the checkboxes press submit and then the f...