.net

VB.net 2010 - IndexOutOfRange from datagridview when refreshing dataset

I have a datagridview on a form that is bound to a table in a dataset from another class. I use a data adapter to .Fill a table in that dataset and the grid displays the data fine. Works fine. On my form I have a textbox the user can type in that will will pass a parameter to the storedprocedure used to fill this table. So on startu...

Wait for asynchronous callback result

I am performing an http web request which asynchronously gets a response from the server. I wish to perform actions on the result directly and do not wish to have any code running in the meanwhile. The reason it has to be asynchronous is that I am writing a silverlight application. Here is a code snippet { .... request.BeginGetRespons...

TTS to Stream with SpeechAudioFormatInfo using SpeechSynthesizer

I am using System.Speech.Synthesis.SpeechSynthesizer to convert text to speech. And due to Microsoft's anemic documentation (see my link, there's no remarks or code examples) I'm having trouble making heads or tails of the difference between two methods: SetOutputToAudioStream and SetOutputToWaveStream. Here's what I have deduced: Se...

How does one convert a .NET tick to a python datetime?

I have a file with dates and times listed as huge numbers like 634213557000000000. I believe this is a .NET tick. That's the number of 100 nanosecond increments since midnight on January 1, 1 A.D. What's a good way to read that into a python datetime object? ...

How to get the name of Sitemap file from Sitemap provider in ASP.NET

I am creating a CacheDependency on the file that my SiteMap provider uses. I would like to get the name of the file from my sitemap provider instead of hard coding it. Is there a way? Edit Duh, I forgot to mention: XmlSiteMapProvider that comes with ASP.NET Edit 2 Reflector shows a private member field called _filename that isn't exp...

ASP.MVC 3 Installation error.

I'm installing ASP.NET MVC 3 Beta and this thing comes out : This product requires Microsoft ASP.NET Web Pages 1.0. Please install the missing component, then try to install this product again. What the hell? I'm using MVC 2 just fine. Should I go and install asp web pages 1.0 and where do I get if from ? ...

Getting Custom UserName Credentials in a WCF Method Call

I have a WCF Service with a binding endpoint with security mode set to "TransportWithMessageCredentials" and a custom UserNamePasswordValidator to handle the credential validations. It's working fine. Since the validation is addressed outside of the service operation/method, is it possible (and if so how) to get the name of the authent...

i'm trying to work with xml linq xdocument in vb.net

I'm trying to write a windows phone 7 app which reads from an xml using xdocument but i'm having a few problems. If I do this: Dim xml As XDocument = XDocument.Load(e.Result) System.Diagnostics.Debug.WriteLine(xml.ToString) Or this: System.Diagnostics.Debug.WriteLine(xml.Elements.Value.ToString) then the xml data is output to the ...

Basic C# Mime Decoding

Is there a clean way of handling multi-part MIME data in C#. After a call to a closed application (I have no access to change it) I get a MIME reponse like the one below. Does C# provide the ability to parse this via System.Net.Mime or System.Net.Mail? MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_42_31322...

Unit Testing in .Net with Endeca Objects

Most or all of Endeca's objects have internal constructors. I'm working on a good project that lacks great test coverage around the Endeca API, are there any good strategies to unit testing the interactions with Endeca? So far the best we have is kind of a poor man's adapter pattern: public class DimValue : IDimValue { public DimVa...

.net replacement for Maven

Came across this today: NuPack Pretty new, but curious if anyone has tried it out and if we finally have a viable tool similar to the Java world's Maven ...

.net dll question

I have a very n00b question about .NET and DLLs. I am developing an application using C# and WPF, and I soon realized that WPF doesn't support charting out of the box. So I did some searches and found WPF toolkit which looks promising, but I have to install a msi file and reference the dll from that project. Now my question is, if I buil...

WCF Custom BehaviorExtension Error: An extension "silverlightFaults" already appears in extension collection. Extension names must be unique.

WCF Custom BehaviorExtension Error: An extension "silverlightFaults" already appears in extension collection. Extension names must be unique. I have a custom behaviorExtension for a silverlight project which helps in communicating faultcontract messages to client. This error occurs when the service is called. Works good in Dev and Q...

Help with GDI+ interop in .Net

I'm using some code to enable me to render rotated text with the TextRenderer.DrawText method. (By default, DrawText can only copy a straight forward x and y transform from a graphics object). The code (C#) is from: connect.microsoft.com. See below for a VB conversion. The code takes a graphics object, creates a device context and copi...

Clean way to retry failed System.Data.SqlClient operations

I inherited a fairly large C# codebase which is littered hundreds of times with the following way of doing DB operations: using (SqlConnection connection = new SqlConnection(connectionString)) {    SqlCommand command = new SqlCommand(queryString, connection);    command.Connection.Open();    command.ExecuteNonQuery(); } However, due ...

WinForm button keeps focus

I have a winform with several buttons, when I hit a button, it runs the Click Event Handler, and then the button keeps selected, so if then I hit the ENTER key in the keyboard, it will run the Click event handler for that button again. I guess this is the default behavior for a button (keeping it selected when its clicked) but I cant f...

Faking DNS resolution on a per hit basis

I'm writing an app that's sole purpose is to determine if one of our core applications is up and running in production. This application is a WCF application. The app is up and running on two different boxes behind a load balancer. The site on each box is configured to listen to traffic for the following DNS name: app.company.com. DNS re...

Running Different version of Unity.

Is it possible to run different versions of Unity within an app? I m referencing an app which uses an old version of unity and the current version of unity i m using the newest version. I get this warning . I tried what the posts suggested but didnt work out. How to get this working? THanks. ...

Database Dependent Caching w/ Multiple Databases/SqlServers

I'm working in an environment where a single web application (running in a web-farm) dynamically connects to different SQL Server databases (possibly on different servers) based on user selection (this part is non-negotiable, unless you can gift me $1,000,000 and/or some kind of time altering device). I'd like to cache some of the commo...

Best practices for editing sln, proj, suo files?

Hi, In .NET, there are SUO, SLN, Proj files for every solution/project. Whilst I know what these files are, is it wise to edit them by hand? Do they ever even need to be edited? If so, what is the best way? Thanks ...