¡@

Home 

c# Programming Glossary: sql

What are the pros and cons to keeping SQL in Stored Procs versus Code

http://stackoverflow.com/questions/15142/what-are-the-pros-and-cons-to-keeping-sql-in-stored-procs-versus-code

are the pros and cons to keeping SQL in Stored Procs versus Code What are the advantages disadvantages.. Code What are the advantages disadvantages of keeping SQL in your C# source code or in Stored Procs I've been discussing.. moment most of the database access is done by building the SQL inline in C# and calling to the SQL Server DB. So I'm trying..

TransactionScope automatically escalating to MSDTC on some machines?

http://stackoverflow.com/questions/1690892/transactionscope-automatically-escalating-to-msdtc-on-some-machines

info on the machines that it works on Dev 1 Windows 7 x64 SQL2008 Dev 2 Windows 7 x86 SQL2008 Dev 3 Windows 7 x64 SQL2005.. works on Dev 1 Windows 7 x64 SQL2008 Dev 2 Windows 7 x86 SQL2008 Dev 3 Windows 7 x64 SQL2005 SQL2008 Developers it doesn't.. SQL2008 Dev 2 Windows 7 x86 SQL2008 Dev 3 Windows 7 x64 SQL2005 SQL2008 Developers it doesn't work on Dev 4 Windows 7 x64..

Returning IEnumerable<T> vs IQueryable<T>

http://stackoverflow.com/questions/2876616/returning-ienumerablet-vs-iqueryablet

is that IQueryable T is the interface that allows LINQ to SQL LINQ. to anything really to work. So if you further refine your.. custs.Where c c.IsGold That code will execute SQL to only select gold customers. The following code on the other..

Random row from Linq to Sql

http://stackoverflow.com/questions/648196/random-row-from-linq-to-sql

and fastest way to retreive a random row using Linq to SQL when I have a condition e.g. some field must be true c# .net.. order by ctx.Random this will do a random ordering at the SQL Server courtesy of NEWID . i.e. var cust from row in ctx.Customers..

ExecuteReader requires an open and available Connection. The connection's current state is Connecting

http://stackoverflow.com/questions/9705637/executereader-requires-an-open-and-available-connection-the-connections-curren

state is Connecting When attempting to connect to MSSQL database via ASP.NET online I will get the following when two.. IDisposable var tblPromotion new DataTable avoid SQL Injection da.SelectCommand.Parameters.Add @PromotionID SqlDbType.Int..

Excel “External table is not in the expected format.”

http://stackoverflow.com/questions/1139390/excel-external-table-is-not-in-the-expected-format

the file without having to open it first Thanks string sql SELECT FROM Sheet1 string excelConnection Provider Microsoft.Jet.OLEDB.4.0.. IMEX 1 using OleDbDataAdapter adaptor new OleDbDataAdapter sql excelConnection DataSet ds new DataSet adaptor.Fill ds c#..

Making Entity Class Closed for Changes

http://stackoverflow.com/questions/11425993/making-entity-class-closed-for-changes

c# .net entity framework linq to sql domain driven design share improve this question For the..

How to execute a stored procedure within C# program

http://stackoverflow.com/questions/1260952/how-to-execute-a-stored-procedure-within-c-sharp-program

which location should the stored procedures be stored c# sql server stored procedures share improve this question using..

Create Excel (.XLS and .XLSX) file from C# [closed]

http://stackoverflow.com/questions/151005/create-excel-xls-and-xlsx-file-from-c-sharp

and fill the data table with the data from the DB string sql SELECT Whatever FROM MyDBTable OleDbCommand cmd new OleDbCommand.. Whatever FROM MyDBTable OleDbCommand cmd new OleDbCommand sql con OleDbDataAdapter adptr new OleDbDataAdapter adptr.SelectCommand..

What are the pros and cons to keeping SQL in Stored Procs versus Code

http://stackoverflow.com/questions/15142/what-are-the-pros-and-cons-to-keeping-sql-in-stored-procs-versus-code

port Advantages for Stored Procs Performance Security c# sql sql server stored procedures share improve this question .. Advantages for Stored Procs Performance Security c# sql sql server stored procedures share improve this question I am..

Returning IEnumerable<T> vs IQueryable<T>

http://stackoverflow.com/questions/2876616/returning-ienumerablet-vs-iqueryablet

should one be preferred over the other c# linq linq to sql ienumerable iqueryable share improve this question Yes both..

When should I dispose of a data context

http://stackoverflow.com/questions/389822/when-should-i-dispose-of-a-data-context

context every time i want to visit the db c# linq linq to sql share improve this question It actually doesn't matter too..

How do I save a stream to a file?

http://stackoverflow.com/questions/411592/how-do-i-save-a-stream-to-a-file

I will need if I store it to SQL Server correct c# .net sql server stream share improve this question You must not use..

Dynamic LINQ OrderBy on IEnumerable<T>

http://stackoverflow.com/questions/41244/dynamic-linq-orderby-on-ienumerablet

VS2008 Examples for Dynamic LINQ that allows you to use a sql like string e.g. OrderBy Name Age DESC for ordering. Unfortunately..

How to get last inserted id?

http://stackoverflow.com/questions/5228780/how-to-get-last-inserted-id

this so I can use that id to insert into another table c# sql sql server share improve this question Change the insert.. so I can use that id to insert into another table c# sql sql server share improve this question Change the insert statement..

LINQ to SQL: Return anonymous type?

http://stackoverflow.com/questions/534690/linq-to-sql-return-anonymous-type

easier way Thanks in advance. c# asp.net linq linq to sql share improve this question I tend to go for this pattern..

How do parameterized queries help against SQL injection?

http://stackoverflow.com/questions/5468425/how-do-parameterized-queries-help-against-sql-injection

to stop insertion of illegal characters. c# .net sql sql server 2005 parameterized query share improve this question.. to stop insertion of illegal characters. c# .net sql sql server 2005 parameterized query share improve this question..

Fastest Way of Inserting in Entity Framework

http://stackoverflow.com/questions/5940225/fastest-way-of-inserting-in-entity-framework

this will lead to an incomplete transaction. Regards. c# sql entity framework share improve this question To your remark..

Random row from Linq to Sql

http://stackoverflow.com/questions/648196/random-row-from-linq-to-sql

a condition e.g. some field must be true c# .net linq to sql share improve this question You can do this at the database..

ExecuteReader requires an open and available Connection. The connection's current state is Connecting

http://stackoverflow.com/questions/9705637/executereader-requires-an-open-and-available-connection-the-connections-curren

Promotion promotion null SqlOpenConnection SqlCommand sql SqlCommandConnection sql.CommandText SELECT TOP 1 PromotionID.. null SqlOpenConnection SqlCommand sql SqlCommandConnection sql.CommandText SELECT TOP 1 PromotionID PromotionTitle PromotionURL.. PromotionURL FROM Promotion SqlDataReader dr sql.ExecuteReader while dr.Read promotionID DB2int dr PromotionID..

Conditional Linq Queries

http://stackoverflow.com/questions/11194/conditional-linq-queries

have the option to filter by user severity etc. In the Sql days I'd add to the query string but I want to do it with Linq...

Soft Delete Entity Framework Code First

http://stackoverflow.com/questions/12698793/soft-delete-entity-framework-code-first

string tableName GetTableName e.GetType Database.ExecuteSqlCommand String.Format UPDATE 0 SET IsDeleted 1 WHERE ID @id tableName.. UPDATE 0 SET IsDeleted 1 WHERE ID @id tableName new SqlParameter id e.ID Marking it Unchanged prevents the hard delete.. code to create the indexes to this public override void Up Sql String.Format CREATE UNIQUE INDEX 0 ON dbo.Organisations Name..

How can I easily convert DataReader to List<T>? [duplicate]

http://stackoverflow.com/questions/1464883/how-can-i-easily-convert-datareader-to-listt

to maps DataReaders to objects. A bit like what LinqToSql does. They save a bit of typing and may reduce the number of.. are likely to be better of using NHibernate EF or Linq to Sql etc However on old project or for other sometimes valid reasons..

C# Object Pooling Pattern implementation

http://stackoverflow.com/questions/2510975/c-sharp-object-pooling-pattern-implementation

object pool strategy for a limited resource in vein of Sql connection pooling ie would be implemented fully that it is..

Can't get sql server compact 3.5 / 4 to work with ASP .NET MVC 2

http://stackoverflow.com/questions/3223359/cant-get-sql-server-compact-3-5-4-to-work-with-asp-net-mvc-2

very obvious here but I've been trying to get the CTP for Sql Server compact 4 to work in my asp.net mvc application. I can.. that install in the base 4.0 direction c Program Files Sql Server compact v4.0 to a lib folder in my application. I've.. to 'Copy if Newer'. I then reference the System.Data.SqlServerCE dll and set 'Copy Local' to True. I created an sdf file..

linq to entities case sensitive comparison

http://stackoverflow.com/questions/3843060/linq-to-entities-case-sensitive-comparison

a command tree. It is then sent to the store provider e.g. SqlClient which convert the command tree into the native database.. as the same by your SQL Server unless you change your Sql Server Collates for that column. Server side solution Therefore.. which is case sensetive by running this on your Sql Server ALTER TABLE Thingies ALTER COLUMN Name VARCHAR 25 COLLATE..

What is Linq and what does it do? [closed]

http://stackoverflow.com/questions/471502/what-is-linq-and-what-does-it-do

hands to avoid dealing with these types directly. Linq To Sql examine the System.Data.Linq namespace. Especially note the.. It is complex powerful and harder to use than Linq To Sql. Linq To Xml examine the System.Xml.Linq namespace. Essentially.. Query Comprehension Syntax this allows you to write in a Sql Like structure. All of this stuff gets translated to the methods..

LINQ to SQL: Return anonymous type?

http://stackoverflow.com/questions/534690/linq-to-sql-return-anonymous-type

way to return results from multiple tables using Linq to Sql Say I have two tables Dogs Name Age BreedId Breeds BreedId BreedName..

Random row from Linq to Sql

http://stackoverflow.com/questions/648196/random-row-from-linq-to-sql

row from Linq to Sql What is the best and fastest way to retreive a random row using..