.net-3.5

Displaying a record_id in "Edit" column querystring in a GridView in asp.net

I have a gridview that displays records from the database. I have a column "Edit" that when clicked navigates to a page where the user can edit values for that record. I need to assign a "record_id" value with the Edit hyperlink querystring. How can I do that? ...

background worker window controls not rendered

Is there any way to load window inside the background worker thread without using showdialog()? the background worker only terminate only after getting some input from the window. Here the issue is window shown but the button and other controls are not rendered even we don't have control over any of the window. private void backgroundWo...

Global hotkey capture in VB.net

I want to have my app which is minimized to capture data selected in another app's window when the hot key is pressed. My app definitely doesn't have the focus. Additionally when the hot key is pressed I want to present a fading popup (Outlook style) so my app never gets focus. At a minimum I want to capture the Window name, Process ID...

LINQ-to-SQL: Could not find key member 'x' of key 'x' on type 'y'

I am trying to connect my application to a SQLite database with LINQ-to-SQL, and so far everything has worked fine. The only hitch was that the SQLite provider I am using does not support code generation (unless I was doing something wrong), so I manually coded the 4 tables in the DB. The solution builds properly, but will not run, givi...

Removing a querystring from url in asp.net

HI, I need to remove a querystring when a user clicks a particular LinkButton. So for example if the querystring is http://UserProfileManager.com?UserID=1234 .... when the user clicks on the Linkbutton, I want the url to be http://UserProfileManager.com. The issue is that everything is on one page, and I am using asp:panel to show and hi...

.Net Removing all the first 0 of a string

I got the following : 01.05.03 I need to convert that to 1.5.3 The problem is I cannot only trim the 0 because if I got : 01.05.10 I need to convert that to 1.5.10 So, what's the better way to solve that problem ? Regex ? If so, any regex example doing that ? ...

Where to store common application settings

I want to move my application settings out of XAML and into a config file. For example, ToolTips and Content strings for Buttons/CheckBoxes and Labels. Is this the job of a ResourceDictionary, or should I use the App.Config or Settings.settings file? The ToolTips and Content strings are not really per user, they are more Application w...

Obtain the Query/CommandText that caused a SQLException

Hello stackers, I've got a logger that records exception information for our in house applications. When we log SQL exceptions it'd be super useful if we could see the actual query that caused the exception. Is there a way we can achieve this? ...

Communicating with all network computers regardless of IP address

I'm interested in finding a way to enumerate all accessible devices on the local network, regardless of their IP address. For example, in a 192.168.1.X network, if there is a computer with a 10.0.0.X IP address plugged into the network, I want to be able to detect that rogue computer and preferrably communicate with it as well. Both co...

Getting value from a texbox in asp.net

Hi, I have a web page which contains multiple panels (used to show and hide various textboxes) and one particular panel contains textboxes that is used to edit records. However, when I am attemtping to update the table, the txtVendorName.Text.Trim() is blank. SqlConnection con = new SqlConnection(strConn); string sql...

Generics and Derived Classes .NET 3.5

Consider the following where class "Circle" inherits from "Shape": dim objListOfCircles as new List(of Circle) DrawShapes(objListOfCirlces) Private sub DrawShapes(byref objListOfShapes as List(of Shape)) for each objShape as Shape in objListOfShapes objShape.Draw() next end sub I can't get this to work. What is the explainati...

Get a property value with only the object and the name of the property (but not the type)

Suppose I have a method that passes in the name of a property (as a string) and the object that the property is on (as object). How could I get the value of the property? Here is some code to make it a bit more concrete: protected override void Paint(Graphics g, Rectangle bounds, CurrencyManager source, int rowNum, Brush backBrush, Br...

VS 2010 .NET Framework issue w/ an assembly targeting 3.5 complains that it needs later version of .NET framework

Hi guys, I'm having an odd issue with an assembly that is targeting .NET 3.5. When including this assembly via Add References/Browse to DLL - it complains: "MyAssembly.dll", or one of its dependencies, requires a later version of the .NET Framework than the one specified in the project. You can change the .NET Framework target by cli...

Web.config HttpHandler pain

Hi all, I've got a .net 3.5 website I've got two types of page, ones that create images and ones that display Html via a in-house framework. I've got a handler that deals with that in-house framework. It works and does a bunch of logging, its called SMS.OutputReporting.Handler the two images pages are normal aspx pages with .Net Syst...

How many instances of the CLR are running?

There is a simple Hello World Console Application. We compile it and get an assembly (EXE). The EXE is copied into 5 different folders and run from each of the locations. How many instances of the CLR are running when the 5 copied instances are running at the same time?” ...

Do Web Deployment Projects work with x86 build configuration

I have a need to build a website and several DLLs that it references in an x86 configuration. To date we have been using Web Deployment Projects to create Zip files of the resultant site and all it's required files. We need to continue to use WDPs however, they seem to have problems with the x86 build configuration. In my project, when ...

Fastest Way to Clean a String to be used in a URL C# asp.net

I've been using this class for a while now to cleans data into such a form that I can use it in my URL's and I was wondering if there's a faster/better way? The order of the replacements is important as it ensures that theres no slashes at the beginning on completion and theres no double slashes in side of the text. /// <summary> /// C...

C# - How to initialize gradient panel demo?

I found a web page that describes how to create a gradient panel in a WinForms application. Does anyone know how to initialize this panel demonstration? There is source code but no comments or examples how the code can be used. ...

Issues with displaying messagebox in asp.net

I have the following message box in c# on my asp.net page inside the btnSubmit_Click event. It tends to popup sometimes and not popup sometimes. Any reasons as to why it is not consistent? ClientScript.RegisterStartupScript( GetType(), "alert", "alert('An email has been sent to Customer Service');", true); ...

How to require .NET 3.5 framework?

My client-side app is built using .NET 3.5, in fact, I want to require that the user has it installed. Before I even start the app, I want to make sure that the framework is present on the box. I tried to use the <requiredRuntime version="v3.5..."/> but it seems that the underlying code can't really tell between .net 2 and .net 3.5 ...