C# ADO.Net TableAdapter objects does not implement and interface nor a base class (other than Component).
Anyone used TableAdapter in a Template like (GoF-) pattern?
Update:
I would like to solve the problem described here:
Help to improve a migration program
by using template (GoF), adapter (GoF) or other nice patterns.
...
This is code from a class library:
proc.StartInfo = new ProcessStartInfo(CmdPath, "+an -b");
proc.StartInfo.RedirectStandardOutput = true;
proc.StartInfo.CreateNoWindow = true;
proc.StartInfo.UseShellExecute = false;
proc.Start();
proc.WaitForExit();
This works perfectly as I would expect when called from a console test app. When I ...
I have a template field in a gridview with a label whose text I want to alter depending on an if statement. The Following of course does not work but this is what i want to accomplish.
<%if Eval("Address") != ""%>
<%{ %>
<ItemTemplate>
<asp:Label ID="Label18" nowrap="nowrap" runat="server" Text='<%# Eval("Address...
I have the following test code:
decimal test1 = 0.0500000000000000045656554454M;
double test2 = (double)test1;
This results in test2 showing as 0.05 when debugging. Why is it being rounded to 2 decimal places?
Thanks
...
I am trying to write a string out to an xml node
strConverted = strConverted + "<sup>" + Mid(strConvertMe, intC, 1) + "</sup>"
Doc = New XmlDocument()
Me.Root.AppendChild(h.BuildXML())
produces XML like this (in part):
String that was converted &#60;sup&#62;2&#60;/sup&#62; more string stuff
see how th...
I suspect I may be wording this question incorrectly (it’s been a while since I’ve done anything in the Microsoft space) but here goes.
In essence, I’m trying to programmatically access an XML document with the ~/Content directory. I’ve tried to do this along the lines of…
XElement resourceConfigXML = XElement.Load(@"~/Content/resource...
I'm trying to get my head around all the claims based windows identity foundation magic.
Assuming I don't want to use ADFS, one thing that isn't clear to me is whether its best to roll your own STS using WIF to do some of the hard work or to rely on a third party.
And if it is the third party option - what third party STS's are there
...
I have a class that I am using to model my data in MVC. I have added some DataAnotations to mark fields that are required and I am using regular expressions to check valid Email Addresses. Everything works fine if the object is posted back to MVC and I have the ModelState property that I can check to confirm that the class is valid but...
For a strange reason that does not matter for this question I need to create a JSON compatible substring that represents a DateTime and that will be manually insterted into a larger JSON string that later will be parsed by .NET's DataContractJsonSerializer. I have come up with the following method:
static readonly DataContractJsonSerial...
Here is an exemple of the situation:
public class ScheduleArea : IArea<Schedule>
{
//....
private Dictionary<int, ScheduleArea> subArea;
//....
#region IArea<Schedule> Members
public ICollection<KeyValuePair<int, IArea<Schedule>>> SubArea
{
get {
return (Collection<KeyValuePair<int, IArea<Schedule>>>)this.subArea;//Error...
Hello
I encountered a simple "problem": Exchange two nodes in a LinkedList (.NET 2) How can I do it in a "optimal" way. Thanks!
Dim label1 As New Label()
Dim label2 As New Label()
'... some code
Dim testList As New LinkedList(Of Label)
'... some code
Dim node1 As LinkedListNode(Of Label) = testList.Find(label1)
Dim node2 As LinkedListN...
NOTE: e.IsRepeat is confirmed to work. The problem exists because I use Remote Desktop from Ubuntu to Windows.
I found a workaround for this Remote Desktop problem:
Disable key repetition in Ubuntu.
In host Windows: Enable FilterKeys with "Turn on Repeat Keys and Slow Keys"
Using regedit go to HKEY_CURRENT_USER\Control Panel\Accessibi...
Is there a way to detect the FlowDirection in TextBox automatically based on the Unicode Characters used?
If you have an Arabic text in Excel it is automatically aligned to the right side of the cell. I would like the same logic in my WPF application. Has anyone experience with this and can tell me how to do this?
...
I am writing Unit tests for a Windows Project. The Executable project on the Client Side of this Windows Project has a code File.Exists("LanguageLookups.sdf") which is used to check and return a Bool if the sdf file exists in the Execution Directory or not. But when i execute the same piece of Code through a Unit test; The code File.Exis...
Today, while talking with my colleague, something odd came out of his mind.
A "secret" way to handle string coming from vb6, which was like:
Dim strSomeString as String
strSomeString = "i am phat"
Mid$(strSomeString, 6,4) = "hack"
This would put i am hack inside strSomeString.
While being surprised of such oddity being supported...
So i'm stuck with the ugly sister of NUnit. Anyone know of ways to speed this up? It appears to be keen to rebuild EVERYTHING when I just want to re-run the tests (which is not neccessary as I haven't changed any code).
While we're at it does anyone know of a way to turn off the: I WILL WRITE ALL MY RESULTS TO DISK "feature" that slowly...
As the title says, what are the compiler, CLR or CPU optimizations to be aware of when working with threads and non-blocking synchronization?
I have read a little about the reordering of instructions to improve efficiency that could break things, and caching optimizations that will result in variables not being visible to other threads ...
Is there any way to make a ValidatorCalloutExtender popup a standard alert box?
...
Hey guys,
I often hear/read about interfaced based programming but I am not exactly clear on what that really means. Is interfaced based programming an actual stand alone topic that actually has books written about it? If so, can anyone recommend any good ones?
I came across interface based programming as I was reading about how good...
The request failed with HTTP status 401: Unauthorized. Why?
TravelCodesTranslator ws = GetEncodeDecodeWS();
// Create and set up the credentials for XmlSelectWebService
string UserName = "username";
string Password = "pwd";
// Xml Select uses Basic Authentication
NetworkCredential credentials = new NetworkCredential(UserName, Passwor...