.net

Using the Ocean Browsercaps files with .NET 4

I have been trying to use the Ocean browsercaps files from http://owenbrady.net/browsercaps/ in a ASP.NET 4 application. When I drop the files into the App_Browsers folder I get the error The browser or gateway element with ID 'docomon505i' cannot be found. Are these files compatible with .NET4 or am I doing something wrong. The docum...

C# Secure Sockets (SSL)

LS, I was planning on writing a wrapper around the System.Net.Sockets.Socket class, because I don't feel like using the SSLStream class because of the negative impact on performance. I found an article which does exactly what I want, but on Windows Mobile. (Link: Enable SSL for managed socket on windows mobile) [Edit] Apparently, the...

App hosting Report Viewer crashes on exit after export

We have a .NET Winforms application that hosts the Crystal Reports Viewer control (Version XI). It works well for the most part but when an export of data from the viewer is performed the application will crash on exit and in unmanaged code. The error message is not very useful and just says that an incorrect memory location was accessed...

LINQ TO SQL, ADO.NET Entity Framework, T-SQL

Greetings, I have a few applications/websites running with LINQ to SQL and the other day I decided to go ahead and optimize some of the queries, etc and I found that the size for variable length data types is derived from the parameter value instead of the column actual size? for example a column is defined as nvarchar(30). when I use ...

How to insert an HTML table into a WebBrowser control C#

Hi There I am using the .NET WebBrowser control to as a WYSIWYG html editor. I've been using the ExecCommand to do the formatting function fine so far, however I now want to add a table inserter. The problem is I can only seem to Append the table to the document, not insert it half way through. Below is some basic test code, if anyo...

Would the instance reference parameters passed into the static methods get garbage collected?

I know that the static objects in .Net managed world are loaded in Loader Heap which is never going to be garbage collected. What happens to the instance reference parameters passed to a static methods. Are they get garbage collected once the static function executed completely Or they are going to live forever as those instance referen...

new Date().getTime() in .NET

Basically i want to do the below in .NET but i have no idea how to. var d = new Date().getTime() + " milliseconds since 1970/01/01" ...

String cannot contain any part of another string .NET 2.0

I'm looking for a simple way to discern if a string contains any part of another string (be that regex, built in function I don't know about, etc...). For Example: string a = "unicorn"; string b = "cornholio"; string c = "ornament"; string d = "elephant"; if (a <comparison> b) { // match found ("corn" from 'unicorn' matched "corn"...

Do we have any event in asp.net where conrols are not initialized

I want to redirect to a page without performing any task on the present page. I think it would be good, if I redirect without loading any control on the page. So I need an event, where controls have not been initialized yet. ...

Is there a generic class to write structured Text Files?

I have several projects that need to write structured Textfiles, some with fixed size fields, other delimited by characters. Is there a .net class that could be used for that? I know there is a "Microsoft.VisualBasic.FileIO.TextFieldParser" that is useful for reading textfiles, i am actually searching for a ""Microsoft.VisualBasic.File...

Accessible read only checkbox in Silverlight

How can I have an accessible read only checkbox in Silverlight? The accessibility requirements are so that a screen reader can read the data as the user tabs through the control. Here’s what I have tried so far: IsEnabled=True is no good because the control can not gain focus which is needed for the screen reader IsHitTestVisible=Fals...

Keep an object for the time the connection is running in ASP.NET

Hi, I'm developing a web service with ASP.NET, is not an .asmx or WCF, it's a custom one, so I'm working with the Http classes (context, request, response, etc..). Session is disabled. I'm working with my own handler and module. I'd like to keep a object alive and accessible for the time the connection is alive. I mean, a request enter...

How do I catch an Exception where the interesting detail is in the Error Code?

My database connection routine can fail, for example, if incorrect credentials are supplied. In this case, a general OleDbException is thrown, with an ErrorCode of -2147217843. The message gives an error such as No error message available, result code: DB_SEC_E_AUTH_FAILED(0x80040E4D) How do I catch this? Using the error code -21472...

How do I get the primary key of the row I just inserted into a typed dataset in .net?

I have some VB.net code that inserts data into my SQL database using a typed dataset as follows: dim usersTa As New authorizedUsersTableAdapters.Authorized_UsersTableAdapter usersTa.Connection = New Data.SqlClient.SqlConnection(MY_CONNECTION_STRING) usersTa.Insert(first_name, last_name) In the database, there is a primary key b...

what is the difference between postback data and view state data.

I am trying to understand different events in a Asp.net page life cycle. I came across to this link. It has two stages Load view state and Load postback data. I used to thought that these both means the same thing. But this article says, that postback data is not viewstate data. I don't understand this. If anyone can have a look. ...

Do breakpoints introduce delay?

How is that setting a breakpoint in my code allows the following code to complete which would fail otherwise. Here is the problem. I'm writing an add-on for SAP B1 and encountered following problem. When I load a form I would like to enter some values into the form' matrix. But without a breakpoint (set on a method in which loading a...

run javascript from a page in code?

Maybe i'll call the project unreasonable and give up on it. There is a page i am sending data to and it is expecting certain cookies to be set in javascript. The code is semi weird. Is there a way i can run javascript on a page to update cookies in C#.NET then continueing submitting my data? ...

Dispatcher.CheckAccess() isn't working from my console application, is there a better way.

I wrote an application in WPF / VB and separated the business logic and UI into different projects. The business layer uses a serial port which runs on a different thread, Now that I'm trying to write a command line interface for the same business layer, it seems to fail when .Invoke() is called. (no error, just doesn't work) I'm pre...

How can i change ClearCanvas DesktopForm application menu's visibility to false_

i try to write a PACS application over ClearCanvas opensource sources. But i can everything over DestopForm only _mainmenu's visibility turn into false stage. // _mainMenu // this._mainMenu.BackColor = System.Drawing.SystemColors.ActiveCaption; this._mainMenu.Dock = System.Windows.Forms.DockStyl...

How to know user has clicked "X" or the "Close" button?

in MSDN I found CloseReason.UserCloseing to know that the user had decided to close the form but I guess it is the same for both clicking the X button or clicking the close button. so How can I differentiate between these two in my code? Thanks all. ...