|
This is really frustrating for me.
I'm using both the DTS Com Component in C#, to programatically create a DTS package, save it, then execute it.
Here's the COM exception that got thrown.
Error Code : -2147024882
Source : Microsoft Data Transformation Services (DTS) Package Description :
Not enough storage is available to complete this operation.
HelpFile : sqldts80.hlp
HelpContext : 1100
InterfaceError {10020306-EB1C-11CF-AE6E-00AA004A34D5}.
This definately, can't be a storage or memory issue, as i have 80gig of HD space and 4Gig of Ram. Please advice.
What this DTS Services does is, grab the access files, and insert it into the SQL Server. If there are 10 files, 10 process will be spawn.
Stanley
|
|
|
|
|
I also had this problem in the past. I tried almost everything that was possible, but did not succeed.
The solution, in my case, was creating an unmanaged COM component in VC (you can try using VB6, too, I bet it'll work) and calling DTS from there. Then, I called this new COM component from C#.
Yes, even I am blogging now!
|
|
|
|
|
See, it's the DTS.dll and DTSPump.dll I'm incorporating.
Anyone ?
Stanley
|
|
|
|
|
This really got me thinking.
Now, instead of spawning the process running concurrently of each other, what if i put those process on a Queue. In other words, the process will run one after another.
Would this be any better ?
Stanley
|
|
|
|
|
Hi Gurus,
I managed to solve this mystery puzzles.
I just want to share with the c# community as to how this problem is fixed.
Now first of all, the problems described aboved has nothing to do with not having enough memory or hd space. The reason why this is happening is due to DTSLookups. Now, my production server is running on w2k Advance Server, and my testing server is on windows 2003 (since we're moving in this path).
On the w2k environment, the dts code works. But, it doesn't work with the w2003 environment. To workaround this issue, I have basically, removed all the DTSLookups and introduce another extra steps (stor procedure) to do what the lookups was doing. Up to this point, no more com exception errors, once the workaround has been implemented.
Note:- The error description thrown here is meaningless.
Stanley
|
|
|
|
|
Hello again, Gurus
1. How can you find out which row and column when the mouse hovers or moves over a DataGrid control? NOT MOUSE CLICKING!!! My app is windows-based C#. I am trying to display the contents of the current cell under the mouse pointer in either the grid's tooltip or context-menu.
I already tried out the DataGrid.HitTestInfo & DataGridHitTest, suggested by another Gury. But It seemed only work with Mouse clicking (MouseDown event) only.
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemwindowsformsdatagridhittestinfoclasstopic.asp
2. I am not sure where to display the cell contents in the grid's tooltip, context-menu, or something else?
Appeciate your input & thanks with another million,
Khang
|
|
|
|
|
DataGrid.HitTest does work, but when not clicking you need to convert the mouse coordinates from screen coordinates to client coordinates. When you click the mouse, the control's event already translates the coordinates for you.
It's quite simple:
Point p = MousePosition;
p = dataGrid1.PointToClient(p);
HitTestInfo info = dataGrid1.HitTest(p); When you respond to mouse clicks, do not translate the coordinates, remember, since they are already translated to client coordinates (client being the control) for you.
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Sustained Engineering
Microsoft
[My Articles]
|
|
|
|
|
Hello again, Heath
I tried both ways:
// Point p = MousePosition;
or
Point p = new Point(e.X, e.Y);
I always got the same row# and col#, no matters where I moved the mouse over the grid data rows:
Row$0:Col$1
Row$0:Col$1
Row$0:Col$1
Row$0:Col$1
Row$0:Col$1
.....
private void dgSelectedParts_MouseMove(object sender, System.Windows.Forms.MouseEventArgs e)
{
System.Windows.Forms.DataGrid.HitTestInfo hti;
// Point p = MousePosition;
Point p = new Point(e.X, e.Y);
p = dgSelectedParts.PointToClient(p);
hti = dgSelectedParts.HitTest(p); // DataGrid
Console.WriteLine(String.Format("Row$0:Col$1", hti.Row, hti.Column));
}
Thanks,
Khang
|
|
|
|
|
For the mouse events you do not translate the coordinates when you use MouseEventArgs , but when you use MousePosition you do (since those are in screen coordinates). I mentioned this in my previous post. If you read the documentation for the MouseEventArgs , you will find this well documented.
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Sustained Engineering
Microsoft
[My Articles]
|
|
|
|
|
Heath, you know everything!
I got the right row# and col# so far. However, I want to display the grid cell contents in the ... (tooltip or contextmenu or something else). Do you know how to do that or a link to the information?
I appreciate your help and thank you so much,
Khang
|
|
|
|
|
Searching the articles on this site or browsing the catalogies is a good place to start. Several articles discuss such features with the DataGrid . Just be sure you're reading an article about the Windows Forms DataGrid (System.Windows.Forms.DataGrid ) and not the ASP.NET DataGrid (System.Web.UI.WebControls.DataGrid ). The two are very different.
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Sustained Engineering
Microsoft
[My Articles]
|
|
|
|
|
Heath, you're very kind and helpful.
Thanks so much,
Khang
|
|
|
|
|
The ASPNET account is only used by IIS for ASP.NET (2002) based web sites. It has nothing to do with Windows applications.
The user that is running the application (you, while you're coding/debugging) has to have permission to access the files in question.
Grim (aka Toby) MCDBA, MCSD, MCP+SB
SELECT * FROM user WHERE clue IS NOT NULL
GO
(0 row(s) affected)
|
|
|
|
|
Hi there.
I need your help again.
Is it possible in C# to save a program that we are running for later, if we want, could load it in the same project again.
What I want is something similar to load file, but instead of a text file I want to load the project that I were running.
Thanks very much, Sérgio
|
|
|
|
|
Hi,
Could you little more specific ?
**************************
S r e e j i t h N a i r
**************************
|
|
|
|
|
Thanks but I already solve my problem.
What I´m doing is to gatther all information in a XML file when I want to save. When I want to load I´m going to the XML file and read all that I need.
|
|
|
|
|
Hello group,
Here is the scenario...
There is a .dll (written in C#) available in the same folder as my application.I'm using reflection to dynamically load the assembly and call the methods available in that dll.
However, the system hangs when it is trying to call the methods in that dll. FYI, i'm able to successfully create an object for the dll's class. The problem is in the line i call the "Invoke" method. That is, the control is NOT passing to the next line after "Invoke" and it remains in the same line for an infinite amount of time. I've attached the method (at the end of this post) for your reference.
Any suggestions would be greatly appreciated.
Thanx,
Ananth
------------------------------------------------------------------------------
//Method starts here
private string CallFunction(string assemblyPath, string className, string methodName, string[] param)
{
try
{
if (! System.IO.File.Exists(System.Windows.Forms.Application.StartupPath + "\\" + assemblyPath))
{
return "The dll is not found in the installation directory.";
}
else
{
assemblyPath = System.Windows.Forms.Application.StartupPath + "\\" + assemblyPath;
}
Assembly objAssembly = Assembly.LoadFrom(assemblyPath);
if (objAssembly == null)
return "";
AssemblyName objAssemblyName = objAssembly.GetName();
string strAssemblyShortName = "" + objAssemblyName.Name;
objAssemblyName = null;
Type objType = objAssembly.GetType(strAssemblyShortName + "." + className);
object o = Activator.CreateInstance(objType);
int ct = param.Length;
object[] paramObj = new object[ct];
for (int i=0;i
|
|
|
|
|
|
thanx for the quick reply.
the method tries to create/update certain records in a oracle db. FYI, i've tested the same dll by other means (without using reflection) and found them working alright.
|
|
|
|
|
But what is the method name at the time that Invoke doesn't seem to return? Use a debugger (like Visual Studio .NET - just hit F5) and step through the code.
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Sustained Engineering
Microsoft
[My Articles]
|
|
|
|
|
There are about 12 methods in that dll and i've tried calling about five different methods...it happens with all those five...so, i belive the problem is not method-specific...
FYI, the OS is Windows2003..could it have any effect?
Thanx,
Ananth
|
|
|
|
|
AnanthRK wrote:
FYI, the OS is Windows2003..could it have any effect?
No, not on a (mostly) platform-dependent framework. Besides, reflection is platform-independent.
I see several problems with your original code. First, why do you get a second MethodInfo by name when you already have a MethodInfo (the current one you're looping through in your foreach )? You never do check for null in cases where you should (making sure you get a MethodInfo for a named method, for example).
Also keep in mind that Type.GetMethods() - with no parameters - gets only public instance methods defined on that Type.
Finally, change your catch and get the whole exception, not some friendly error message. These are much more helpful when debugging. A TargetInvocationException can happen for many reasons. Knowing the exact reason (the Message and InnerException properties, if the latter is assigned) will be greatly more helpful.
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Sustained Engineering
Microsoft
[My Articles]
|
|
|
|
|
How can I use c# to insert,update,delete,select Xml Node like operate database?
Is there some examples?
thanks!
|
|
|
|
|
Non-specific questions like these are best answered by reading the .NET Framework SDK, specifically sections like Employing XML in the .NET Framework[^]. This sections includes many topical articles, examples, and links to class library documentation which is very important to read.
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Sustained Engineering
Microsoft
[My Articles]
|
|
|
|
|
We have problems with two software packages. Both packages require the .NET framework be installed. Both vendors software works great for the ADMIN, but both throw exceptions for users that are not ADMIN.
Can you point me in the right direction?
thanks
|
|
|
|