Tag: .net

Programmatically Retrieving MS SQL View's columns including Alias in .net/C#?

How to retrieve the columns (including alias) name, tables involved in a ‘View’ in C#?

Error at the transport level when sending a request to the server

Strange System.Data.SqlClient.SqlException Error at the transport level when sending a request to the server. (Provider: Shared Memory Provider, error: 0 – Since both ends of the canal there are no processes.) I’ve got this exception on my Web Site every time after restarting my SqlServer on simple request like this : if (System.Web.HttpContext.Current.User.IsInRole(“Administrator”)) but after […]

Create the Provider db tables after RecreateDatabaseIfModelChanges

I’m new to EF4, usign CPT4 Code-First and SQLExpress (MVC2 + Ninject but does not matter). It’s working good but I do have one question/problem. When I change my model the database get drop and created back because I added this line in my OnApplicationStart() { Database.SetInitializer<CorpiqDb>(new RecreateDatabaseIfModelChanges<CorpiqDb>()); } But I use the Applications Services […]

.net: Best practice for exception handling while using Transactions?

Is there any best practice for exception handling while using transaction? I should say that I use Sql server as my data source and VB.net 2010. Thank you

EXEC sp_spaceused query

I have a requirement to scrape 3 million documents. They are all text and varchar fields. For sample I just scraped 250 documents and when I ran EXEC sp_spaceused it gave me 26.6 MB as Database size. I want to know can we calculate the size required to store 3 million documents from this? Offcourse […]

open external files or applications from sql command using sql server

i want to open notepad, word or excel files from sql server using some query. is this possible? or is it possbile using C#.NET winform application. ? also, i want sql to use dll files present it my hard drive. how do i do both these tasks? please help me out with the code as […]

What SQL Server role do you pick for a normal user for ASP.NET Membership?

I used Integrated Security for a database connection for the first time for a website. The website pool uses Network Service as a user. I added Network Service as a SQL Server user mapped to public, then allowed it access to my database as websiteuser. There are many aspnet_… roles to choose from. Any links […]

Is it better to save upload file into SQL Server?

Possible Duplicate: store image in database or in a system file ? I am wondering if it is a better idea to save uploaded file into SQL Server. And if it is convenient to download the file stored in DB. If it works, what type of field should I use to store file? Any help […]

Entity Framework: Generated SQL – cannot find data type datetime2

So we migrated dev sql server to 2008. Our UAT sql server is still 2005. i had to regenerate my entity framework model for some other reasons, and upon deploying my work to UAT i noticed this error: cannot find data type datetime2 I profiled the database, and noticed that Entity Framework generated the input […]

Entity Framework 5 wrong data type in query

We are using EF 5.0 as our ORM of choice in our business solution, structured in a n-layer fashion with everything decoupled and a nice composition root with ninject. Lately, we’ve been building a database that uses partitioning underneath, and we have some important indexes on DATE columns. The columns are correctly declared on Sql […]

MS SQL Server is a Microsoft SQL Database product, include sql server standard, sql server management studio, sql server express and so on.