.net

Best way to transfer bitmap object over lan

I need fastest way to transfer bitmap object over the lan in C#. Abdul Khaliq ...

Image animation stops on minimizing and restoring

I have a .NET WinForms application with an animated GIF in a PictureBox. It's a loading animation, shown while a BackgroundWorker does some processing in another thread. I load the image by setting the Image property and it animates on its own. All is fine until I minimize and restore the application. At which point, the image stops ani...

Replace text in WPF Richtextbox.

How to replace a character in WPf richtextbox? ...

How to update only one row in a DataGridView?

I have a DataGridView that's populated from a DataTableAdatper, as in this tutorial. I guess since it's an ODBC MySQL connection, it's not generating DBDirectMethods for me. My question is how do I update a specific row in the DB after the user has edited it in the grid? Do I need to specify a DeleteCommand in my adapter? When would it...

Design question-offline web application

Hi, I have a requirement to design an offline web application The requirement goes like this, Current aplication Its a .net web application collect surveys from users. New requirement When web server is not available we have to give the user an option to fill the survey offline and later submit it when the server is connected. What ...

C# casting back to var type?

Hi, I am working on an ASP.NET application using LinqToSQL. When the page loads I run a query and save the results into a variable... var tasks = query expression. I then save this into a session variable Session["Tasks"] = tasks... Is it possible to cast this session object back to its original var state, so I can run methods such as...

How to get all classes within namespace?

Possible Duplicates Taking out all classes of a specific namespace Getting all types in a namespace via reflection Excuse me. How to get all classes within namespace? ...

To increase the timeout period

hi guys, I have to increase timeout period.Following is my code. Private Function GetConnectionInstance() As SqlConnection Dim objConn As SqlConnection Dim strConnection As String strConnection = ConfigurationSettings.AppSettings("conn") Try objConn = New SqlConnection(strConnection) Catch ex As Exception ...

How to have a WPF binding update every second?

I want to show the user how many seconds have passed since some event occurs. Conceptually, my view model has properties like this: public DateTime OccurredAtUtc { get; set; } public int SecondsSinceOccurrence { get { return (int)(DateTime.UtcNow - OccurredAtUtc).TotalSeconds; } } If I bind a TextBlock.Text property to SecondsSi...

set the png images on dark background??

Hello, i want to set png images on dark background like black. i am displaying my images in picture box.but it is n't working... could any one help me?? thx in advance.......... ...

Generating JavaScript with templates in ASP.Net

I have a need for generating JavaScript on the server. I can do this by using ASPX pages to template JavaScript but I'm getting warnings and I don't benefit from syntax hilighting which I would like. Is there a way to tell the .Net environment/Visual Studio that a certain ASPX page is supposed to output non-HTML text? The reason for thi...

How to set Progress bar on Message Box

I want to set progress bar on my message box how to set ...progress bar property style have Marquee property..... Message box code is bellow....... MessageBox.Show("Data process please wait .", "Data progress ", MessageBoxIcon.Information); ...

Reload app.config with nunit

Hi I have multiple NUnit tests, and I would like each test to use a specific app.config file. Is there a way to reset the configuration to a new config file before each test? ...

BouncyCastle RSAPrivateKey to .NET RSAPrivateKey

I'm creating a certificate distribution system to keep track of clients and stuff. What happens is: Client send CSR to Server Server checks and signs certificate Server sends Signed certificate to Client Client puts Signed certificate plus Private key in Windows store. So on the client this happens: //Pseudo Server Object: Server s...

Weird AJAX/JS bug in ASP.NET and Infragistics NetAdvantage.

I have a quite simple data capture web app. In the main capture window, when you save a row in a UltraWebGrid, depending on certain flags two more windows open (with a ScriptManager.RegisterStartupScript). One of the windows, works perfectly fine. The other one, when it gets closed (by means of its own ScriptManager.RegisterStartupScr...

Determine version of SQL Server from ADO.NET

Hi, I need to determine the version of SQL Server (2000, 2005 or 2008 in this particular case) that a connection string connects a C# console application (.NET 2.0). Can anyone provide any guidance on this? Thanks, MagicAndi Update I would like to be able to determine the SQL Server version form the ADO.NET connection object if poss...

ADO.NET Query optimisation

I have a bit of a strange one happening. The first query I got from running a profiler on a C# ADO.NET application. What it is doing is not as interesting as the way the parameters are being passed - This query is taking 250+ seconds to complete, but when I modify it (Query 1) by changing the way the parameters are passed (see Query 2), ...

C# Best way of assigning values to strings in a loop

Hi, I wonder what is the most efficient way of assigning string variables in a loop. So, for example if I have to browse through a list of nodes and assigning the value of the node to a string, would it be better if I define a variable before the loop starts like string myStringVariable = string.Empty foreach(XmlNode node in givenNodes)...

How to serialize only certain object properties.

Given such object: Foo foo = new Foo { A = "a", B = "b", C = "c", D = "d" }; How can I serialize and deserialize only certain properties (e.g. A and D). Original: { A = "a", B = "b", C = "c", D = "d" } Serialized: { A = "a", D = "d" } Deserialized: { A = "a", B = null, C = null, D = "d" } I have wro...

How to run C# project under Linux

Hi all! Do you know any ways to run a C# project under Linux. Are there any framewoks or libraries for this? Regards. ...