Hello SO,
I've just finished going through the MvcMusicStore tutorial found here. It's an excellent tutorial with working source code. One of my favorite MVC v2 tutorials so far.
That tutorial is my first introduction to using ADO.NET Entity Framework and I must admit that most of it was really quick and straight-forward. However, I am...
Hi I found problem with EF.
Here is my Model
I loaded asset:
POCO.Asset asset = _context.Assets.Where(a => a.UID == assetUid).First();
then I go through all properties
foreach (POCO.Property p in asset.Properties) /* request to db */ { /*...*/ }
categories:
foreach (POCO.Category p in > asset.Categories) /* request to db */ { /*...
Hi
In our project user using NHibernate 2.1.1 with SQL Server 2008 with .net 3.5.
I am facing strange problem with SQL Server. We developed windows service, installed it and it was running fine for sometime. Unfortunately by mistake when I stopped SQL Server, NHibernate throw exception
System.Data.SqlClient.SqlException: A
netwo...
I am retrieving columns of different types and checking for null before assigning the class's corresponding property. For string column Its all good. However, I need to decide what to do for the DateTime, Bool and the Enum type?
a) Do I should use nullable DateTime property for Class A or there is a better practice?
b) Is the checking ...
Im trying to call a Oracle stored proc from a C# application using the following code
Connection conn = new Connection();
Recordset rs = new Recordset();
conn.Open("Provider=MSDAORA;User Id=username;Password=password;Data Source=DB;", null, null, 0); ;
rs.Open("sproc 'abc', 'xyz'", conn, ADODB.CursorTypeEnum.adOpenStatic, ADODB.LockType...
I have a stored Procedure that do some operation and return 1 or 0 as below
CREATE PROCEDURE dbo.UserCheckUsername11
(
@Username nvarchar(50)
)
AS
BEGIN
SET NOCOUNT ON;
IF Exists(SELECT UserID FROM User WHERE username =@Username)
return 1
ELSE
return 0
END
and in C# i want to get this returned value i try ExcuteScalar b...
I use oracleclient by creating DbProviderFactory and get schema:
DbDataReader reader = cmdForSchema.ExecuteReader(CommandBehavior.KeyInfo);
DataTable schemaTable = reader.GetSchemaTable();
however both float and number have DbType.Decimal as their DataType in in schemaTable. At least we're using NUMBER for integers and it would be nic...
Using Microsoft's ADO.net, one can you query database -> disconnect database connection -> query/manipulate locally -> connect again (re-synchronize local with database).
I've found value in this as overall it can minimize database hits.
Does ActiveRecord support such a model/pattern?
...
I have a Tags table and an Objects table.
A record of their relationships is kept via the ObjectTags table which has two columns. The columns store ObjectId and TagId (from the Tags and Objects tables), and both make up a composite key (can't have TagId and ObjectId twice).
In Entity Framework this table is not mapped as an object but...
Hello,
What are the implications (in each case) of declaring a database context ex: mydbEntities as either:
public static mydbEntities db = new mydbEntities ();
public mydbEntities db = new mydbEntities ();
private static mydbEntities db = new mydbEntities ();
private mydbEntities db = new mydbEntities ();
I'm using ASP.NET MVC 2. ...
This seems really ridiculous.. what am I missing?
I have an access database with 5 tables.
I want to fill a dataset with the entire contents of the database.
Why can't it roughly look like this?:
dim dConnection as new oleDbConnection(connection info)
dim dAdapter as new oledbdataadapter(SelectCommand, dConnection)
dim dSet as oleDb...
I would like to create a WPF application that is using a local database. I have created a simple database and added it so I can see my database NameDB.sdf in my Solution Explorer.
How do I connect to it from my application?
I have tried with an empty application that just tries to connect to the database:
...
using System.Data.SqlServ...
Hi,
I'm aware you can map multiple storage tables to a single entity if they have a one-to-one relationship in EF 4.0.
Example:
(storage)
(1)Table: People
Columns: Name, Age
(2)Table: Customers
Columns: Registered
--
Relationship: People <1-1> Customers
(concept)
Entity: Customers
Columns: Name, Age, Registered
I'm wo...
Application works fine and connects every single time from any machine except the server, where it's supposed to be deployed :/ When run on the server it manages to connect once in like 20 or something attempts. Judging on the funky symptoms, I suspect it to be some kind of a network configuration related issue (as in some randomly lost ...
Hi friends,
I have the following issue. I request you to please post your suggestions.
Problem:
1. I have stored the result of DB operation in a DataTable in a Session variable.
2. Created a new DataTable variable say 'X' and assigend the DataTable stored in the Session variable.
3. Performed few operations on the newly created Data...
What are the cases when timeout occurs in SqlConnection.Open()?
On one of our IIS boxes 10 seconds after AppProcess was recycled the following exception appeared:
Type : System.Data.SqlClient.SqlException, System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
Message : Timeout expired. The timeout period e...
I have a table with a PK column of type uniqueidentifier.
I am trying to write an update statement from C#, where I have the identifier as a string.
Here is the code I am trying:
string sql_start = "update SecurityUserGroup set ";
int paramPos = 0;
var paramList = new List<SqlParameter>();
if (roleName !=...
The System.Author Windows property is a multiple value string. Windows Search returns this value as an array of strings in a DataColumn. (The column's data-type is string[] or String().) When I call the WriteXML method on the resulting data-table, I get the following InvalidOperationException exception.
Is there a way to specify the da...
Hi All,
I am developing asp.net application. I have 3 values for the same key in web.config
eg: add key="ids" value="12333,43434343,434232".
In aspx.cs iam calling like this.
string merchantIds = ConfigurationManager.AppSettings["ids"];
string paramName = null;
foreach (string ids in merchantIds.Split(','))
{
paramName = ids; ...
I have a set of sql scripts which I send to SQL server using a SqlCommand object in C#. These scripts create stored procedures and as long as I just create the procedures, everything works finde. If my scripts contain the usual "if exists ... drop XYZ; create procedure XYZ ..." block, I get an error which tells me, that create must be th...