.net

How to incorporate modal popup in .net?

I have an aspx page where there is a hyperlink control. On click of the hyperlink, I want to open another aspx page as a popup.Presently I am doing this by using javascript popup. <script language="javascript" type="text/javascript"> function openpopup() { testwindow = window.open('ViewPlanner.aspx', "mywindow", "menubar=0,toolbar=0...

Right align WPF window title

I'm currently creating a WPF Exception Window, much in the style of the MessageBox (static show methods). In attempting to style it similarly, I have created a ExceptionWindowOptions enum which contains the value, RightAlign. When the RightAlign flag is tagged in the MessageBox class, the window title is aligned to the right (next to th...

reportviewer parameters

I have a winform with a datefield. When a user selects a date and submits, a reportviewer on the page takes the date as a parameter through the tableadapter and shows the report. What I need is a way to print the user selected date on the report. Can someone show me how to pass a value from the winform to the rdlc file and make it pri...

How to use managed code from unmanaged code?

How do I call a .NET code from native C++ (unmanaged code)? I want to expose .NET code to my unmanaged (C++) application and then use them. More specifically, I want to call C# from native C++ :). I know there are many ways but can you tell me the pros and cons of each? By the way, I don't want to use COM so what are the options now? I...

C# code to search and result in xml

I’m after some C# code that will have the following methods that will return Xml as the result. Search the Apple iTunes App store. If I pass it a name or partial name the function must return a list of possible search results or just one result if it is a perfect match. Example shown below: <App> <AppId>321564880</AppId> <Name...

Limiting the size of the managed heap in a C# application

Can I configure my C# application to limit its memory consumption to, say, 200MB? IOW, I don't want to wait for the automatic GC (which seems to allow the heap to grow much more than actually needed by this application). I know that in Java there's a command line switch you can pass to the JVM that achieves this.. is there an equivalent...

How to implement linked list type structure in C#?

I have a requirement for linked list type traversing in c#, What structure i should use for my project Please suggest.. ...

C# OpenFileDialog Lock To Directory

Hello everyone! I am making a software that needs to ONLY be able allow people to select files and folders using the OpenFileDialog that are in the same directory as the program and that are in deeper folders. I don't want the OpenFileDialog to be able to select stuff outside of the program's current directory. Is this possible to do in ...

Is BigInteger immutable or not?

In .NET 4 beta 2, there is the new Numerics namespace with struct BigInteger. The documentation states that it is an immutable type, as I would have expected. But I'm a little confused by the post-increment operator (++). This defintely seems to mutate the value. The following while-loop works: static BigInteger Factorial(BigInteger ...

.NET PrintDocument - Text gets cut off

I have an application (C#, .NET 3.5) that writes receipts. They are usually printed with a small receipt printer with the .NET PrintDocument. The problem is the exception cases where I want to print with a regular printer. In these cases the text gets cut off. I wish to have a check or a switch to prevent this, but still keep the tight m...

Call Oracle Oracle Procedure with inputs and output

Hello, I'm trying to call an Oracle stored procedure. This procedure, has 2 input paramters (first is decimal, second is DateTime), the third is an output cursor. I tried several code but no way, impossible to get data .... one parameter si missing (the output) I tried this : OracleConnection con = new OracleConnection(); con.Connect...

Restrict Characters in Datagridview Cell

I have a column which is of integer. when i edit this cell,i need to enter only numbers but not characters. Am not using datagridviewTextboxColumn.It is a cell. It should not allow typing characters just like a textbox_keyPress event where we give Char.IsDigit to restrict characters. How do i do this in C# ? Thank you ...

Imagelist cf.net and .net designer problem

After some testing, I found out that streaming of ImageList using CF WinForms designer is different from streaming using WinForms designer. If images are added using cf.net designer and form is reopened using winfrorms designer an exception "Method 'System.Windows.Forms.Design.ImageListDesigner+OriginalImageCollection.Add' not found. " i...

wsdl 404 problem

I'm having problems with a web service. I published the site on IIS 6. With my browser the interface works fine. When I try to create a proxy with wsdl.exe, It gives me 404 not found error. Is there any trigger in IIS that I should turn or what? ...

Offline database synchronization with Server

We are having a client-server architecture where client goes offline when connects remotely to server. Server is essentially a SQL Server 2008, with few tables each with thousands of records. Each client application (WPF) would require to store replica of Server data for their offline use (in SQL Express?). And ideally when client applic...

Automatic resizing of the Windows Forms controls.

I'm using VS2008's designer for doing this. For example if I've a windows form of size say 500x500 and I added a DataGridView to it (490x490). when I run this program. and maximize the form, the DataGridView still remains of the same size. rest of the additional space is blank on the form. I want DataGridView to also take the entire w...

debug vs. release dll size

Why in cpp a dll in debug mode is X10 bigger than release while in .Net they are almost the same size? ...

How to match string containing lots of \r\n\f using regular expressions?

Hello everyone, I want to capture word "assignment" only when it is found at the begining of line and line ends after that word.There can be zero or more space characters after "assignment" word and characters like : or # or - might come. For example following lines should match Assignments or Assignments : or assignments Whe...

What to log/trace in a Production environment

Hi All, I'm wondering what kind of information should be logged to a file once an application has moved into a Production environment? Besides the logging of exceptions and errors... Should the start and end of each method be logged? The start and end of a running service? Each time the application saves data to a database or calls an ...

LINQ use with XML

Hi! We have a project in which access the DB layer (MS SQL) with LINQ. Can we now change our DB layer to XML file and still access it with the same LINQ? We want add possibility to store data in a single XML file or a set of XML files. Current LINQ to SQL code looks like: result = (from e in db.Organizations where e.Id == id...