SQL Bulk Stored Procedure call C#
How do I call stored procedures in bulk? I would like to do something like a bulk copy. All that the stored procedure does is 8 selects for unique constraint and 8 inserts. With no returning value. ...
How do I call stored procedures in bulk? I would like to do something like a bulk copy. All that the stored procedure does is 8 selects for unique constraint and 8 inserts. With no returning value. ...
Warning -- I'm not an xml guru. Here is what I have: <Fields> <Field name="BusinessName" look-up="true">My Business</Field> <Field name="BusinessType" look-up="false">Nobody really knows!</Field> </Fields> This maps back to: [XmlArrayItem(ElementName = "Field")] public List<UserInfoField> Fields; and [Serializable, XmlRoot("F...
All of the examples for SelectMany I see are flattening arrays of arrays and so on. I have a different angle on this question. I have an array of a type, and I want to extract that type's contents into a stream. Here's my example code: public class MyClass { class Foo { public int X, Y; } static IEnumerable<int...
In a Windows 2003 domain, I would like to create a SRV record programmatically at install time to advertise to clients where my server is located. Since I do not have the luxury of running as Domain Admin, what kind of permissions do I need to have to create the SRV record? Generally I'd be using the .NET classes to create the SRV reco...
How can I serialize a list of Exception objects (also including derived exceptions, eg. FileNotFoundException) with the DataContractSerializer? I always get an error about the serializer not knowing the types in the list so i devised a workaround. It looked something like this: Dim XmlSerializer As New DataContractSerializer(Excep...
I'm referencing a class in a .net library in VB6 and need to profile it. Is there a profiler that can be pointed at a .net library dll? The memory issues I wish to profile only happens when used in the VB6 application. The pure .net test application for the library does not have memory issues. ...
I am developing a .Net server application, which is supposed to run continously. I would like to have a notification email sent each time the server process is terminated for any reason. Ideally the email should contain the exception message and stacktrace if an exception caused the termination. I am aware that certain exceptions can not...
I have a Windows .NET application that I plan to "port" and tailor to a mobile device. The application consists of a standalone .NET program that works with a barcode scanner, has a simple UI and records the scans to a file. There is also a Windows Service that synchronizes data to a server using web services (proprietary sync protocol...
I would like to add a check to ensure all appSettings used in my class indeed exist in the configuration file. What is the most reliable way to do this? I know I could check each value for null, but are any of you guys using an XSD approach? Or do a more dynamic approach, or is the best way to manually check and maintain a list of value...
I have a question today involving the StreamReader class. Specifically initializing this class using the filename parameter for example: TextReader tr = new StreamReader(fileName); Obviously when this action is finished, its important to close the stream like this: tr.Close(); I would like to have this in a try / finally, the prob...
I'm using WCF RoleService (I built a custom role service on top of it) to get a list of roles for a given user. What I'm wondering is, should I be setting the FormsAuthenticationTicket's UserData property (when it's created) with these roles on the server side? Note: I guess it doesn't make sense for a client application to do this (I'...
So far I've been placing the dll into the /bin folder because it seems to be the only place it will get loaded when a DllImport'd function is called, but it just doesn't feel right since it's the output folder and it'll probably be wiped after a 'project clean' or 'rebuild all' operation. How should I do this? Thanks in advance. Note: ...
Is there a quick and reliable way to check if a WCF service is available and accepting requests, perhaps some best practice built in method? Obviously from code. Thanks ...
Guys, When I create a custom role provider by inheriting from RoleProvider, I created a method called public override string[] GetRolesForUser(string username) .. However, when I try to use this Service Reference all I have access to is GetRolesForCurrentUser(). It works and calls my method behind the scenes ok. As in, GetRoleseForCurre...
... Just like the ShowInTaskBar property of a WinForms form. ...
I had an idea just now and I think it's pretty good. Select whatever code you want from your .cs/.vb file and on right click there will be an option that says 'Upload to PasteBin'. Where would I start? ...
I'm working on improving my skills in other languages, coming from using c++ as my primary programming language. My current project is hammering down C#.net, as I have heard it is a good in-between language for one who knows both c++ and VB.net. Typically when working with an unknown number of elements in c++ I would declare my variable...
Map reduce/Hadoop is one of the framework/program that s used for distributed systems. What are some other popular frameworks/programs? Thanks. ...
I'm working with the XtraGrid Suite made by DevExpress. I can't find any sort of functionality to do this, but I'm curious if you can add a button or hyperlink to a grid cell. Context: I've got an Events list. Each Event has a Time, Start/End, and a Category (Utility and Maintenance). There can be Start events and Stop events. Having do...
I want to do something like this: List<SomeClass> list1 = ... List<SomeClass> list2 = ... Predicate<SomeClass> condition = ... ... list2.RemoveAll (!condition); ... list2.AddRange (list1.FindAll (condition)); However, this results in a compiler error, as ! can't be applied to Predicate<SomeClass>. Is there any way to do this? ...