.net

Can Entity Framework model be passed a SQL script to be run against the database

Is it possible to pass a SQL script to some method that Entity Framework has to run it against my model? e.g. equivalent of: context.ExecuteStoreCommand(<tsql script path>); Background: I want a way to reset the database during unit tests, and making a call to run the EF generated TSQL script (from Generate Database from Model) seem...

what test data approach/framework is recommended for .net unit testing

Hi, what test data approach/framework is recommended for .net unit testing? I'm in VS2010, C#, doing business logic layer testing. By approaches I mean like: creating database snapshots, programmatically creating each time, etc etc. Like what approach to use to ensure at the start of each test the database is in a known state. ...

.NET TCP Client/Server communication issue

What I'm currently trying to do is make a very basic webchat for irc using silverlight. Basically how I'm trying to do it is have a tcp server listening for connections from silverlight. When a client connects it creates a new connection to irc and data is passed to/from the client/irc via the server application. I've gotten it to work...

DotNetOpenId openIdRelyingParty Setup

Hi all, I'm new to .Net and am trying to setup dotNetOpenID. I'm simply trying to get the following line to build ok without getting any errors: var openIdRelyingParty = new OpenIdRelyingParty(); Currently when I build, I get the following error: The tpe or namspace name'OpenIdrelyingParty' could not be found (are you missing a usin...

Facebook .net return internal server error when using Multiquery

Hello I am having trouble using multiquery in facebook .net. I am trying to create 3 queries: Friends, Like and Photo using multiquery in the toolkit. It returns me with this The remote server returned an error: (500) Internal Server Error. Although, it is not happened all the time but it does occur frequently... I thought about what ca...

Is there any program that obfuscates C# source code?

Our requirement is being able to integrate our DLLs with ClickOnce. Dotfuscator does the obfuscation job nicely but the obfuscated DLLs cannot be deployed with ClickOnce on customer side. On our side, we can handle it perfectly. Moreover, the obfuscated assemblies sometime crash our .NET CF app. It turns out to a solution that creates a ...

F# and .Net versions

I'm writing a program in F# at the moment, which I specified in the Visual Studio project setup to target .Net 3.5, this being the highest offered, on the theory that I might as well get the best available. Then I tried just now running the compiled program on an XP box, not expecting it to work, but just to see what would happen. Unsur...

Best C# API to create PDF

Can you recomend any PDF API for C#. Free is the best, but i dont mind paying for it. ...

Help required in adding new methods, properties into existing classes dynamically

Hi All, I am not sure whether it is possible to achieve this kind of implementation in Dot Net. Below are the information Currently we are on an application which is done in COM+, ASP, XSL, XML technologies. It is a multi tier architecture application in which COM+ acts as the BAL. The execution steps for any CRUD operation will be def...

what's the right way to bind sqldatasource to asp:label in asp.net 4.0?

Is it possible using Eval? If so, can someone post a short fragment to illustrate? My SqlDataSource returns 1 record with 3 fields, I'd like to Format these into a string. eg: Record Field 'Name' = 'Jack' Field 'Amount' = 100 Field 'Date' = 12.02.2010 asp:Label text should end up being: Welcome Jack, last payment was 100 on 12.0...

Installer Vs. Desktop application

hi, I was just wondering why do we need installer programs to create setups? We can create a desktop application which will do registry changes, registration of assembly, creation of config files and all. Why dedicated installers are there? Do they serve any other purpose or task that a desktop application cannot do? ...

Generic SQL builder .NET

I'm looking for a way to write an SQL statement in C# targeting different providers. A typical example of SQL statements differentiating is the LIMIT in PostgreSQL vs. TOP in MSSQL. Is the only way to solve SQL-syntax like the two above to write if-statements depending on which provider the user selects or using try catch statements as ...

HttpWebRequest response produces HTTP 422. Why?

Hi there. I'm trying to programmatically send a POST-request to a web-server in order to login an then perform other requests that require a login. This is my code: byte[] data = Encoding.UTF8.GetBytes( String.Format( "login={0}&password={1}&authenticity_token={2}" +"&login_submit=Entra&remember_me=1", ...

.net IHTTPHandler Streaming SQL Binary Data

Hello everybody I am trying to implement an ihttphandeler for streaming files. files may be tiny thumbnails or gigantic movies the binaries r stored in sql server i looked at a lot of code online but something does not make sense isn't streaming supposed to read the data piece by piece and move it over the line? most of the code seems to...

Old dll.config problem !

Since 2005 as I googled it's a problem for who needs to read the configuration of an assembly from it's config file "*.dll.config" and Microsoft didn't do anything yet. Story: If you try to read a setting from a class library (plug-in) you fail. Instead the main application domain (EXE which is using the plug-in) config is read and beca...

What is the difference between f and F

In the following code, the const are defined using two different ways. const float KS = 0.001F; const float WW = 0.001f; Is there any difference between F and f? Revision 1: If both are same then why both cases are allowed ? ...

ASP MVC2 - Dynamic Field Layout

I'm new to MVC and ADO.net Entity Framework. Instead of having to create an edit/display for each entity, I'd like to have the controller base class generate the view and validation code based off metadata stored in a table - something along those lines. I would imagine something like this has already been done, or there are good reas...

Differens between page["propertyName"] and page.property["propertyName"] in EPiServer?

Hi, What is the difference between accessing a property through page["propertyName"] and page.Property["propertyName"] in EPiServer? Thanx! ...

how to make an setup file

i am new to program,and our teacher asked us to write a small program witch using sqlserver; so i use visual studio 2010 c# to write it,but i meet a problem: i don't know how to make a setup file.because i put the SqlConnectionString in the code file directly;so,even i have publish the program ,the sqlconnectionstring didn't change,it di...

Question About TransactionScope in .NET

using (TransactionScope scope = new TransactionScope()) { int updatedRows1 = custPh.Update(cust.CustomerID, tempPh1, 0); int updatedRows2 = custPh.Update(cust.CustomerID, tempPh2, 1); int updatedRows3 = cust.Update(); if (updatedRows1 > 0 && updatedRows2 > 0 && updatedRows3 > 0) { scope.Complete(); } } ...