|
The Excel Providers default behavior is to determine the column datatypes by scanning the first 8 rows. This is can be modified somewhat by setting the MAXSCANROWS property in your connection string (in the EXTENDED PROPERTIES part). This accepts a range of values 0-16. 0 means scan the whole table. If you scan the whole table column data types will be based on a 'majority rules basis, which can cause columns with mixed text and numeric data to start failing one or the other. Another alternative might be to set IMEX=1 in the connection string (also Extended prperties). this sets 'import export mode" so all columns are interpreted as text regardless of content. Not sure how this agfects the string length determination, but it might be the best bet for your situation.
Anger is the most impotent of passions. It effects nothing it goes about, and hurts the one who is possessed by it more than the one against whom it is directed.
Carl Sandburg
|
|
|
|
|
My client exe refering a assembly dll version 1.o which is in GAC.
As i found some bug in dll version 1.0, i corrected it and make it version
2.0.Now i want my client exe to refer 2.0 without compiling the client exe
again.How to do this.
|
|
|
|
|
If you want to redirect all applications on a machine which use this assembly, you can use Publisher Policy[^] to redirect all uses of this assembly to the new version.
Things to be aware of:
The framework looks for a publisher policy file with the major and minor version of the assembly reference. If you patch this assembly again, calling it v3.0, and you want clients which need v1.0 and v2.0 to use v3.0, you'll need to ship policy.1.0.assemblyname.dll and policy.2.0.assemblyname.dll. I'd recommend keeping the same major and minor version numbers for patches, incrementing only the last two parts of the version number (build and revision). Only change the major and minor version number for breaking changes in the interface.
You must use the same strong-name key to sign policy assemblies as the original assembly.
You must set the version number on the policy assemblies. The GAC install process will silently fail to overwrite a policy assembly with the same or lower version number.
It isn't fully clear in Microsoft's documentation - you CANNOT embed the policy XML file in the assembly DLL file. The assembly must link to the policy file.
The publisher policy system is most useful for security patches.
If you want to redirect a single application, you can use bindingRedirect[^] elements in the application's configuration file.
You should generally default to not putting your own assemblies in the GAC. See this blog post[^] for reasons.
Stability. What an interesting concept. -- Chris Maunder
|
|
|
|
|
Not certain what is required when developing a packaging and deployment application for a C# windows program with several forms. First, when the application is built using the Build menu command, does it incorporate the forms into the executable itself, or do the forms need to be included individually into the application. If they are required to be individually included into the application, then is there perhaps some way that these files could ALL be converted to individual .dll files or even incorporated into a single .dll files, or something? It would seem to me that if each file were required to be included into the application individually, that they would be too vulnerable -- any suggestions?
Also, when the path to files are written in the code for your application, and the files are expected to be stored in "C:/windows/" directory, for example, the package and deployment folder for Windows could store the files in WINNT or in Windows based upon which operating system is loaded onto the client computer. Since the programmer does not know what operating system the user is utilizing, how would the programmer write the path information to where the files are expected to be installed by the installer? That is, is there some environmental variables code that would work with the package and deployment program in which the deployment application makes the determination where to store the files during installation, and the code path to the files would agree with that path decision? Is there some code like Application.windir() or something?
Third question. If an application required the installation of other applications, or even the .NET framework itself, does the package and deployment application provide a transparent way of installing these applications first without the end user realizing that they are being installed? We have all seen the applications that have several installation modules included, and they are considerably bothersome to the end user. I would like to install the other applications and even the .NET framework transparently without the end user knowing that it is occurring. That is, if the .NET framework is installed already, then ignore, else install. If the third party application is installed already, do likewise. Any ideas?
Would really appreciate the input on these questions, as I do believe that others would like to hear the answer as well. Thanks.
|
|
|
|
|
1. Each project is build into a single file. So if you have just your main project (which generates the exe) all forms will be included in the resulting executable file.
2. Your are searching for System.Envornment.GetFolderPath
3. Those installs inside an installation are called merge modules. It depends mostly on what you want to install silently and cannot be answered in general. E.g. I dont Ms Office can be successfully installed silently.
With the .Net framework its slightly different. You will need another setup.exe. Im sorry to say that I have currently no link for you at hand.
|
|
|
|
|
Unfortunately, there is no merge module for the NET framework. You also cannot include it in your installation, although you can include it on the disk if you are using media to distribute your application. If you are using web distribution you can create a bootstrapper that will download the NET framework from the web.
See this link:
http://support.microsoft.com/default.aspx?scid=kb;en-us;324733[^]
|
|
|
|
|
Hi,
I'm working on a text editor that uses syntax highlighting. It's an SDI application with a CRichEditView. I have a procedure SetTextColor(CRichEditCtrl &) that sets the color of keywords and comments in the text contained in the control (using SetSel() and SetWordCharFormat()). The problem is that the user should not be able to undo the formatting done by this procedure. I'd like to know if there is any way to turn off the undo function during formatting.
|
|
|
|
|
It will probably be obvious I'm at a novice level in .Net (so maybe that's why all my Googling for this answer isn't working...maybe I'm too confused/inexperienced to understand what I'm reading).
Anyway, for my Windows app I'm creating a DataGrid at runtime and tying it through its DataSource property to a DataTable. When I use the asterisk row on the visible DataGrid to enter data in the three columns for my grid and then continue tab past (i.e., a new asterisk row appears) the row is clearly visible in the DataGrid. But it does not appear to exist (based on my debugging) in the DataTable. I thought "Maybe DataSource isn't two way" so I looked for an event that would get thrown by the DataGrid when the asterisk row was completely entered so I could provide a handler to manually add the row to the associated DataTable, couldn't find one in the .Net members for DG. So now I'm kind of at a loss.
Thanks in advance for any advice, patience and/or redirection to tutorials/examples!
|
|
|
|
|
The rows you add in the grid should directly be added to your DataTable, when its finished. This happens when the row you are editing looses the focus. This is also true when changing data. If you want to see when exactly the row is added to the table add an eventhandler to the CellChanged event of the DataGrid and trace the count of the DataTable:
<br />
private void dataGrid1_CurrentCellChanged(object sender, System.EventArgs e)<br />
{<br />
Console.WriteLine("Count: " + ((DataTable)dataGrid1.DataSource).Rows.Count);<br />
}<br />
You could also catch the RowChanged event of the DataTable and check the DataRowAction.
|
|
|
|
|
Thank you very much for your explanation and the time you took to include sample code. It is embarrassing for me to admit but the exception that was being thrown about my referencing past the end of the DataTable row list was due to my confusion over 0 based vs. 1 based indexing, I had falsely concluded that the row I had just added was not yet in the DataTable. Your explanation broke me out of my narrow thinking, plus you introduced me to Console.Writeline as a way of easily confirming what's going on in events while you work with GUI controls. Thanks again!
|
|
|
|
|
I want to place a button on my form such that it appears to be rotated counter-clockwise 90 degrees. This means that the text is rotated as well, not just stacked vertically, which could be accomplished by simply setting the button size to be tall and narrow.
Any pointers on how to do this would be greatly appreciated.
Thanks,
Dave
|
|
|
|
|
Hi,
I have a couple of Region objects which I want to draw the outline of on top of a picture which resides inside a picture box.
In the event handler for the picture box I perform the following code:
Graphics g = e.Graphics;
foreach (Region region in regions)
{
IntPtr hdc = g.GetHdc();
IntPtr hBrush = CreateSolidBrush(ColorTranslator.ToOle(Color.Black));
FrameRgn(hdc, region.GetHrgn(g), hBrush, 1, 1);
DeleteObject(hBrush);
e.Graphics.ReleaseHdc(hdc);
}
When calling FrameRgn I receive the following error message:
'System.InvalidOperationException'
The object is currently in use elsewhere.
Any help would be greatly appreciated!
|
|
|
|
|
Hi.
I have a program that reads a database and displays its graphics into a CScrollView Instance. To do that it reads records from the database and creates a small metafile for each of it. Finaly, when all those metafiles are created it replays them over the view and displays those that are part of the visible (on screen) window.
I want to create that view invisible (not on the screen) and using the same functions I would like to create all those metafiles. Then rather than replaying them on the display I would like to save them in the disk as EMF.
So far I manage to create the EMF and to replay over it the metafiles. However, I am always getting a part of my image in the saved file and not the whole image (wich be larger than the screen). I do not display the view on the screen thus the CGetClientBox CGetClipBox functions return a zero size rectangle. I 've tried to use functions to manipulate the window extend and the viewport but I am not sure that I understand them.
Can some explain to me what are window origin/extend versus viewport ones? And how can I affect the size of a disk saved MetaFiles?
Thanks a lot
Dimitris
|
|
|
|
|
I've got the following problem: I have a DLL written in C++, that exports a function. That function basically puts a very simple CDialog object on the screen (either modal or unmodal).
I have a very simple forms-based C# program that uses this DLL to call the exported function. Everything works OK.
Now, I add a custom control in the CDIalog-derived class, in C++, using an OCX that was developed by another company. When having this OCX, the C# code calls the exported function, but the dialog is not shown.
If needed, I can provide the code.
Any ideas why I have this problem?
|
|
|
|
|
There is many things in the design of the .NET type system
I do not understand why it should be like that:
- Why are we not allowed to provide parameterless constructors
for value types? (I find it a large limitation, since I sometimes
need defaults/initialization other than the process provides)/li>
- Why is the ValueType derived from Object?
- Since the derivation of ValueType from Object, makes it a class why boxing?
- Why is "ValueTypeArray" not provided instead of just Array for everything?
- Why is there no common base ValueType for numerics/numbers?
I recently found myself writing a class like,
public class TestClass
{
private ValueType m_valueMax;
public TestClass(ValueType value)
{
m_valueMax = value;
}
public ValueType Value
{
get
{
return m_valueMax;
}
}
}
instead of
public class TestClass
{
private object m_valueMax;
public TestClass(object value)
{
m_valueMax = value;
}
public object Value
{
get
{
return m_valueMax;
}
}
}
because I simply needed a number to be passed it, and do not
need to be doing stuff like
if (value == null)
throw new ArgumentNullException("value");
Best regards,
Paul
Jesus Christ is LOVE! Please tell somebody.
|
|
|
|
|
I have a Windows Forms application that has problems with a web service reference. When I add the Web Reference, and try to go to design mode on the main form, I get an "Object reference not set to an instance of an object." error. There is no line number, no indication of what object or where in the code, just that error. Removing the web reference completely from the project resolves the problem, and adding it back causes the problem to appear again.
Does anyone know why I would be getting such an error when I add a Web Reference to a windows forms application? Its a very confounding problem, and I havn't been able to find anyone else on the net having the same problem. I appreciate any help.
|
|
|
|
|
I've got a strange problem when using the standard save/open file dialog Windows Forms controls in C#/.NET applications. When I call the "ShowDialog()" method, the dialogs open and behave normally in every way, except that all of the icons for folders and files have a black background, and the buttons on the left hand side of the dialog - for Desktop, My Documents, etc - are totally black. Does anyone have any ideas?
Thanks.
|
|
|
|
|
I am having the same issue. The issue has started in the past month. We believe the Dec 13th .NET framework update may have caused the issue.
I have also seen the file name text box and the file type drop down missing. There may be a floating empty drop down on the form above the bottom panel section.
Have you had any progress on determining the cause of the issue and a resolution?
|
|
|
|
|
Hi.
How do I force Windows to go standby using the .net framework in C# ?
also
How do I force Windows to shutdown ?
thanks
|
|
|
|
|
|
hello friends,
i just want to know wheather their is any api in .Net,com etc for geting the open with dialog,as like we get in windows when we try to open any of the files with no extentions.
if there is any other implementation other than reading from the registry ,plz let me know.
regards
Deepak
deepak
|
|
|
|
|
I feel useless!
I am trying to develop an app in VS. Specifically I am trying to build an app that has several frames. Here's my problem. I am trying to set up one of the frames as an aspx (so I can program the code behind page) but I can't. It seems you can associate the frame with an html page but not an aspx document. How do I get around this? I suspect that my whole appraoch is fundamenatlly flawed but at this time I don't know how so.
thanks in advance.
Brian
|
|
|
|
|
For some reason this returns false on my machine (SP2 VS 2005 Beta 1 latest refresh IPv6 installed). However my app (currently only a simple test app) runs binding to a IPv6Any interface and I can connect to it via an IPv6 Address. Anyone have any ideas?
Matt Newman
Even the very best tools in the hands of an idiot will produce something of little or no value. - Chris Meech on Idiots
|
|
|
|
|
Looking through the decompiled code for SupportsIPv6 reveals that there's a configuration property ipv6[^] which must be enabled in order for this property to return true .
I'm not too sure why this is required - perhaps you should report it as a bug on the Product Feedback Center[^].
Stability. What an interesting concept. -- Chris Maunder
|
|
|
|
|
Hello everyone
Sorry to be asking so many questions...
I have seen a few examples around the net where people are passing bytes in to functions wanting ints, without any problems what so ever...
e.g. Color.FromArgb (0x99, 0x99, 0x99);
I have also seen this being used when an overload expects a float value;
e.g. g.DrawImage(img, (int) (rect.X + 4), (int) (rect.Y + 2), 0x10, 0x10);
All these compile fine!
Now is there a reason why someone would choose this method over just passing an int or float?
Is there any benifit to this?
Sorry, a very trivial question, but has got me very intregued!
Thanks in advance
Al
|
|
|
|