.net

Could not load file or assembly 'MySql.Data, Version=6.2.2.0

I am working on Desktop application with c# and Data base MySQl. When I install its installer on my machine it works fine but when I install it on other machine its give following exception when try to access DB. I am using MySQL.Data.dll to communicate with MYSql. --------------------------- Could not load file or assembly 'MySql.Dat...

PrintPreview Window in C#

Hello Techies, In my windows application in .net, i need to have Print Preview option for an excel file. The followings are my codings. //Excel.Application excelApp = new Excel.Application(); Excel.Workbook wb = excelApp.Workbooks.Open(@"C:\\Documents and Settings \\Admin \\Desktop \\DoCoMo\\ news5.xls", ...

How do I check whether the user has scrolled to the bottom of a WebBrowser control in .NET?

I am using a WebBrowser control to display a webpage and would like to enable a button on the form, but only if the user has scrolled to the end of the webpage. Is there any way to simply do this without having to override WndProc or something similar? Thanks :) ...

How to change windows Applicatoin's default icon in Setup Project

How to change the Windows Application's default icon with other one in C# desktop application. I am trying to change it in Setup Project but it is not. I want to show my own icon with Application's shortcut rather then windows default icon ...

List or ArrayList?(lots of items)

which one is more memory efficient? which one works faster with 1000000 items? is there anything better? ...

How to find if a value is NULL in SQL Server using c#

I would like to know which values are null in datatable in c# that is returned from ExecuteDataTable of SqlHelper class. string select = "select * from testTable"; string val=""; DataTable dt=dbcon.ExecuteDataTable(select); foreach (DataRow dr in dt.Rows) { foreach (DataColumn dc in dt.Columns ) { if(dr[dc].Equals (null)...

Association properties not loading on entity.

I have three related entities, best described by this diagram: When I load a user, using the following code, the User object is loaded, i.e. not null, but the Role and Department properties on the User object are null, despite User database record having valid FK values for these associations. using (var productionEntities = new Pro...

Project Layout and Site Structure in ASP.NET MVC

I'm new to ASP.NET MVC and would like to create and deploy a website using ASP.NET MVC. I have a few old sites that run classic ASP and the site-structure goes like this: web.root (holds website pages) data.files (holds databases) log.files (log files) I was wondering if the same structure is used for ASP.NET MVC?? What’s the best ...

log4net - FileAppender writing new entries at the beginning of file

Is is possible to configure FileAppender in log4net to add new entries at the beginning of log file? Currently it is adding entries at the end and reading newest entries requires scrolling whole log down. It would be more comfortable to read from the beginning. ...

What's the use of a finally block preceded by a catch-all catch block, in C#?

Consider the following C# code structure (S0-S3 are placeholders for arbitrary code blocks): try { S0; } catch (Exception ex) { S1; } finally { S2; } S3; In the case that S1 throws an exception inside the catch handler, S2 inside the finally will still execute (but S3 will not). Question Assuming that S1 cannot throw, i...

WCF Service default values

Hi I have following data contract class for my WCF Service: [DataContract(Name = "MyClassDTO")] public class MyClass { private string name = "Default Name"; [DataMember] public string Name { get { return name; } set { name = value; } } } When I use Visual Studio's Add Service Reference function to...

Using LibTiff from C# (to access tiled TIFF images)

Hi, I'd like to use LibTiff to access very large TIFF files. I need functions like multiple pages and tiles, and so LibTiff seems to be the right way to go. Can anyone help me on how to use LibTiff from C#? I've found some links (like blog.bee-ee which contained partial code. But I couln't get beyond getting a version. I've looked at Fr...

Is there any documented free R-Tree implementation for .NET?

I found some open source R-Tree implementations in C#, but none with documentation nor signs of being used by someone else than the developer. ...

Is a form Disposed when the user closes it from window bar/etc.

Is a System.Windows.Forms.Form automatically disposed when the user closes it with the top right X, or Alt+F4 ? The form is shown with form.Show(this), not form.ShowDialog(...); ...

How to determine a full path of a named folder?

I want to determine the full path of certain folders. In my array, I just have the names of the folders, but when my application will get installed on another user's machine, my program must be able to determine the full-path of these folders. How to get the fullpath? ...

In Silverlight, how do you find out whether the code is running in the UI thread or not?

Basically I need to know whether I need to can Dispatcher.BeginInvoke or if it's not needed. Thanks. ...

Is PrintSystemJobInfo.JobStream broken?

I get the queue from my targeted printer and goes through the list of jobs on it. When a job is not IsSpooling, I try to read the JobStream to see the print job. So far JobStream has always been null. My printed stuff comes from on DOS application and should be pure text. I've Paused the printer to safe the rain forest, but I should sti...

Does an IO exception in .NET get thrown if the file system is full??

As above but doesnt windows buffer the file system?? Does this mean that when you write this could work but later when flushed it throws an exception.... Have I got this right ...

Fine-grained visibility for 'internal' members

Recently I was reading about partitioning code with .NET assemblies and stumbled upon a nice suggestion from this post: "reduce the number of your .NET assemblies to the strict minimum". I couldn't agree more! And one of the reasons I personally see most often, is that people just want to isolate some piece of code, so they make the typ...

searching listview in vb.net one-by-one

I am trying to search through items in listview control in vb.net one by one. i.e When the user types in some keyworrk in the textbox and presses enter, the first found item in the listview should get highlighted, when he presses enter again, the second search item in the listview should get highlighted and so on. I am not fully aware ...