I have the following database tables:
Table1: UserUserIdUsername
Table2: RoleRoleIdRolename
Table3: UserRoleUserIdRoleId
A User can have many Roles and a Role can have many Users.
When I model this with EF, I get a User entity with a list of UserRole entities. What I want is a User with a list of Role entities.
Is there a way to ...
How do I view the SQL generated by entity framework ?
(In my particular case I'm using the mysql provider - if it matters)
Duplicate: http://stackoverflow.com/questions/137712/sql-tracing-linq-to-entities#138109
...
Please someone help me!
I have an app running on windows 2003 with sql server 2005. When I try to deploy this some app in other server on windows 2003 with sql server 2000, some pages of the app shows the message bellow:
Server Error in '/' Application.
Line 1: Incorrect syntax near '('.
Description: An unhandled exception occurred dur...
Hi, what are the new features (if any) in ADO.Net 3.5 as compared to 2.0?
...
I have a problem that adding ( overwriting existing 123 key) does not work, how to force updating a row if conflict occurs?
db.OpenRecordset("table1", dbOpenTable)
.AddNew ' create a new record
.Fields("key") = "123"
.Update ' stores the new record
code works when DB does not have key 123 yet
...
The linefeed does not appear in access db:
Set db = OpenDatabase("C:\temp\a.mdb")
db.OpenRecordset("table1", dbOpenTable)
.AddNew ' create a new record
.Fields("memofield") = "123" + chr(13)+"line2"
.Update ' stores the new record
...
Hi,
In MS Access I have a query wich takes two parameters and I'd like to get the result of this query in a ADO.NET DataSet with a TableAdapter.
In Visual Studio Express 2008 I can't select the query in the assistant. In fact it seems I can't select any queries with parameters. Is there any way to use am Access parameterized query in A...
Any advice on when DataTable.Select should be used versus LINQ Select when dealing with an in-memory DataTable?
I find LINQ syntax easier and more powerful, but I'm not sure if there are performance or other issues which make a DataTable select preferable.
(I'm using a third party API that provides a DataTable that has been pre-populat...
I have the following ado.net code, if I already use using to wrap my DBCommand, do I have to close the underneath connection explicitly?
Thanks,
public static void ExecuteSQL(int Id)
{
Database db;
const string sqlCommand = "Stored Procedure Name";
try
{
db ...
Heloo All,
I have two simple tables. Tbl_Users, Tbl_Roles.
Tbl_users is defined as...
UserID --> PK(Varchar)
UserName
Password
RoldID(Int)
Tbl_Roles is defined as ...
RoleId --> PK(int)
RoleDescription(varchar)
Data Model is ADO.NET Entity Data Model, SilverLight3.0(Navigation Apllication), .NET RIA Services Class Lib.
All I need t...
I'm trying to build the server/network settings system for my IRC client. Because of the relational nature of the networks and servers I opted to use SQLite to store everything.
My first step is making the settings dialog, which is like you might expect; a TreeView that holds the networks and server, and a space on the side to edit thei...
I create a custom dataset that I pass off to a black boxed component. The dataset consists of usually 5-6 tables (with unique names assigned by me). The component takes the dataset and builds a drop down combo box based off the table names. What I am needing to do though is to change the ordering of the tables within the dataset. I n...
I heard that SQL Injection can still be possible when using ADO.NET SQLParameter (paramterised query) for SQL Server.
I am looking for real examples in C#/VB code as proof.
EDIT:
I am looking for SPECIFIC working examples. Not introductions to sql injection or how to prevent it.
...
I have a c# .net program where I need to first insert data into a table using a sql connection and then adjust the same set of data using ADO.net. I am not sure how to make sure the insert via the sql connection is complete before doing the ado.net changes. I am getting a concurrency violation when I try the code below. I would guess ...
An asp.net application I am working on may have a couple hundred users trying to connect. We get an error that the maximum number of connections in the pool has been reached. I understand the concept of connection pools in ADO.NET although in testing I've found that a connection is left "sleeping" on the ms sql 2005 server days after the...
Hello everyone,
I want to know SQL Server Express edition, like SQL Server 2008 Express edition,
whether totally free or not (e.g. free for a period of time or free for ever)?
I heard no management tool like SQL Server Management Studio for Express edition, is that true?
If I have some code which works on SQL Server Enterprise edition...
Hi,
I'm hoping someone here might help me.
The company I work for would prefer that I use MySQL instead of MSSQL.
So I downloaded the latest driver (6.1) and am porting the DB layer.
However I can not find the BeginExecuteReader function which takes a callback as parameter.
Is this for a reason? Or does it work differently with MySQL...
Hi,
I have question I'm developing small application to desktop in win Forms. I'm using SQL CE 3.5 SP1 for the database.
When I make inserts on few tables by few methods I'm using the TansactionScope. When I use this methods alone I want to use normal Transaction from database connection.
Is there anyway to check in called method if...
Hi all!
I am going to make an web application where a lot of users are going to input data into a SQL Server with ASP.NET 3.5. There will be no heavy load of data sent to the client as data will be set to pagesized from the database. Stored procedures are used.
I am asking you guys with experience in web 2.0 aka AJAX, jQuery and other cl...
I have an ADO.NET connection object to an SQL Server (which will use connection pooling and all the nice things about it) in one Winforms application.
We're adding some new stuff to this application and we thought that we could do it in LINQ to SQL, the question is, if we open a new connection like this:
MyDataContext dc = new MyDataCo...