.net

Insert data into SQL server with best performance

I have an application which intensively uses DB (SQL Server). As it must have high performance I would like to know the fastest way to insert record into DB.Fastest from the standpoint of execution time. What should I use ? As I know the fastest way is to create stored procedure and to call it from code (ADO.NET). Please let me know ...

.net equivalent for Java's Swing TableModel?

Hi, I'm a Java developer wich is just starting to learn .net. When coding my user interfaces with Java we can count with the TableModel interface wich makes the process of representing objects in data tables something really easy. In .net what is the equivalent? I don´t want to show data which is stored on databases, but the tabular re...

Parse XML and populate in List Box

I'm a newbie to C#. I want to develop C# List box in Windows Form. I found this link to be helpful. But the input to the List box will be an XML of the following format: <LISTBOX_ST> <item><CHK></CHK><SEL>00001</SEL><VALUE>val01</VALUE></item> <item><CHK></CHK><SEL>00002</SEL><VALUE>val02</VALUE></item> <item><CHK></CHK><SEL>00003</SE...

is there something equivalent to 'Address of' or offset operator in .net?

We have nested stuctures as such, used as an interface for some device drivers. On occasion we have to update individual elements. An 'address of' operator would be helpful, but an 'offset' function or operator is what I'm really looking for, but not sure how to go about it. In other words, how far is structureN.elementX away from the st...

How can I locate an open web services call in .NET/WCF?

I'm working on a project where a large number of clients will be connecting to a WCF web service. When they connect, the web service will sleep until an event occurs on another WCF service running on a different server. I want the other service to "wake up" the client service when the event occurs using another WCF service call on the ba...

Invalid character in a Base-64 string

I am getting this error when I am validating the user with sql membership provider this.provider.ValidateUser(userName, password); the password i have used is "freetrial". I tried trimming the spaces but still no luck!!! and the call stack is as follows: [FormatException: Invalid character in a Base-64 string.] System.Convert.F...

Is there a .NET REST framework that meets these requirements?

We just started a greenfield project. A part of requirements is to provide application server Api as REST services. I found few ways to do it using OpenRasta, Windsor WcfFacility. From what I see on Web is not much information on this topic. I'm looking for a framework with support of: non intrusive api security interface versionning ...

Unable to access Remoting object members when hosting in Windows Service

I have what I thought was a simple .NET Remoting Client/Server (Code Below)... When hosting/running in a Console application it works fine, but when hosted in a Windows Service, all calls to members of proxies returned from Activator.GetObject result in a NullReferenceException. To simplify things I placed all this in a single Console a...

Convert date/time string value to .NET DateTime

Hi guys, i've this string example value: Sun, 09 May 2010 11:16:35 +0200 I've to insert it into MySql Date/Time field. How can i convert it into .NET format (or Mysql format), so i can make my INSERT INTO mydate='2010-05-09 11:16:35' ? Thank you ! ...

Is there any parallel in Objective-C to C#'s yield keyword

The first time I saw the yield keyword in C# I thought "yuck what a way to junk up the language". Having grown since then and actually used the language I find it so pleasantly simple to express state logic that I'd like to use a similar approach in other development platforms. I'm exploring Objective-C for some support utilities. Is ...

Are there any good .Net libraries for building arbitrary sql commands? Not relational data.

I am looking for some library that takes the TextWriter approach to writing SQL commands (much like there is the HtmlTextWriter in .Net for writing html). I am NOT writing CRUD-type commands for relational data, I am writing arbitrary SQL (bulk inserts, table creation, creating backups, etc). Any suggestions are appreciated. ...

How can I specify a single .config file for multiple EXE projects in .NET

I have a project that I am breaking up into multiple .exe projects. I still plan on publishing them, using click once, into the same location at the same time, and I would like to use the same config file. I have added the app.config to each project using the "Add link" option in Visual Studio, which is great for debugging, but in produ...

Using StructureMap, when a default concrete type is defined in one registry, can it be redefined in another registry?

In the project I'm working on I have a StructureMap registry for the main web project and another registry for my integration tests. During some of the tests I wire up the web project's registry, so that I can get objects out of the container for testing. In one case I want to be able to replace a default concrete type from the web reg...

Service Layer which can switch between Web Service Layer and Data Access Layer

I am building an application that will function as a client-server application, and also as a disconnected client application. I will be using WPF (browser app for client-server application). When interacting with the server's database, I will need to connect using WCF web services. When connecting with the localized database, I wil...

GUI style question: Icons in context menus?

Hi, It seems like not so long ago that it was standard to have icons/images in context menus and Microsoft seems to keep this up. But nowadays it seems to have disappeared in other apps: Chrome, iTunes etc. Anyone have an opinion / idea why this has happened or is it just completely personal taste (I for one like the images). A. ...

One config file for multiple environments

I'm currently working with systems that has quite a lot of configuration settings that are environment specific (Dev, UAT, Production). Does anyone have any suggestions for minimizing the changes needed to the config file when moving between environments as well as minimizing the duplication of data in the config file? It's mostly Appli...

Getting an exception when trying to use extension method with SortedDictionary... why?

I'm trying to place custom objects into a sorted dictionary... I am then trying to use an extension method (Max()) on this sorted dictionary. However, I'm getting the exception: "At least one object must implement IComparable". I don't understand why I'm getting that, as my custom object obviously implements IComparable. Here is my c...

How to visualize sound?

When music is playing how can i draw a wave? ...

Does System.Web.mail (CDonts) issue smtp quit commands?

.net System.Net.Mail does not issue SMTP quit commands in version 3.5 or lower. Although the problem is fixed in .net v4.0 RTM, unfortunately v4.0 cannot handle attachments in an email larger than 3-4MB's so I can't use it in my solution. I was thinking of maybe rolling back to the now outdated CDonts found in System.Web.Mail. Can anyo...

can I have an abstract base class with the key attribute being generic

Hi, I want to create a re-usable library. I was going to use extension methods however I run into some issues in some cases for the client to have to specify in the calling method the types. QUESTION - If I use an abstract base class as the basis, can I specify an attribute/property in the class to be generic (e.g. the key property m...