|
jasper018 wrote: but I do not see how I could be out of memory
Just a wild guess but maybe memory is not an infinite resource
Use "virtual mode" see the documentation for details
|
|
|
|
|
Hi,
I am facing a problem while using pepared statement for inserting data in MS-Access db.
<code>private const String CONN_STR = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\\Temp\\TestDb.mdb";
conDatabase.Open(CONN_STR, "", "", -1);
String sQuery = "INSERT INTO " + sTableName +
" ([FileName],[IsCopied],[Size]) VALUES (@FileName,@IsCopied,@Size)";
cmdPrepStmnt.ActiveConnection = conDatabase;
cmdPrepStmnt.CommandText = sQuery;
cmdPrepStmnt.CommandType = CommandTypeEnum.adCmdText;
cmdPrepStmnt.Prepared = true;
int iCount = 0;
foreach (FileInfo f in fInfo)
{
Console.WriteLine("Adding File " + ++iCount + " of " + fInfo.Length + "; " + f.Name);
Parameter p1 = cmdPrepStmnt.CreateParameter("@FileName", ADODB.DataTypeEnum.adVarWChar, ParameterDirectionEnum.adParamInput, 255, f.FullName);
Parameter p3 = cmdPrepStmnt.CreateParameter("@IsCopied", ADODB.DataTypeEnum.adBoolean, ParameterDirectionEnum.adParamInput, 10, false);
Parameter p5 = cmdPrepStmnt.CreateParameter("@Size", ADODB.DataTypeEnum.adInteger, ParameterDirectionEnum.adParamInput, 10, f.Length);
cmdPrepStmnt.Parameters.Append(p1);
cmdPrepStmnt.Parameters.Append(p3);
cmdPrepStmnt.Parameters.Append(p5);
cmdPrepStmnt.Execute(out objAffected, ref obj, 0);
}
</code>
FileName is coming as blank in db, while in debug mode i can see that it is being set with a proper filename. The other 2 params are inserting fine.
The FileName field is set as Text field with width length 255, and the incoming data is always shorter than 255 chars. The insertion happens without any errors/exceptions. I have also tried replacing the data for filename with a string like "Test", still it is inserting blank string.
Please help.<code></code>
|
|
|
|
|
Access uses the ? placeholder for parameters, not SQL Server type parameters. It is positional based, so you should use something like
String sQuery = "INSERT INTO " + sTableName +
" ([FileName],[IsCopied],[Size]) VALUES (?,?,?)";
Then, add your parameters using CreateParameter("?", ....); in the order they appear in the list, i.e. FileName then IsCopied an finally Size.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
I found recently that named parameters do work with Access/Jet, and they can even be used more than once, but they still need to be in order.
I didn't respond to the post earlier because the code doesn't look like OleDb / ADO.net
|
|
|
|
|
this is slightly stupid but how do i pass command line arguments with Visual Studio???
|
|
|
|
|
Select Project->Properties menu item, then (in the newly appeared window) select the Configuration properties->Debug node and finally set the command line arguments line content to whatever you need.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
Hi,
I'm wondering if there's any way to disable "Close" button on window's title bar?
Thanks in advance.
Goran
|
|
|
|
|
Have you looked at the properties on the form?
|
|
|
|
|
Actually, I forgot to tell that I need this in TreeView derived control, not on Form derived control.
So, the question is how to disable "Close" button in .NET's class which is derived from Control class, in my case TreeView control?
I'm sorry I've missed full information.
-- modified at 11:11 Monday 30th July, 2007
|
|
|
|
|
To display the treeview you still have to put it on a form?
|
|
|
|
|
I'm not sure what you mean. I'm creating TreeView derived control programmatically and I'm not able to disable "Close" button.
|
|
|
|
|
In .Net a TreeView is a control. Controls go on forms. FOrms are then displayed to the user. The close button is on the form. To disable the close button you must access the properties on the form.
If your not putting your treeview on a form what are you doing?
Edit:
Are you talking about WinForms or Asp.Net?
|
|
|
|
|
Do you mean "collapse"? To keep the nodes from being collapsed? (Not closed?)
|
|
|
|
|
Does anyone know of an alternative to Pegasus' ImagXpress for opening/viewing/scrolling an image? The product works very well, but the licensing fees are way too high ($60,000-$100,000).
Thanks
R.Myers
|
|
|
|
|
Leadtools - www.leadtools.com/
or
Accusoft - www.accusoft.com/
Leadtools has no runtime fees, which is pretty darn nice. Pegasus looks like a great product, but how in the heck do they justify the pricing structure?
|
|
|
|
|
Thanks, I appreciate the input.
|
|
|
|
|
Most of the Image toolkits are expensive and have some form of runtime licenses or reporting requirements. I have used Accusoft controls in the past, from a development perspective it is easy to use and feature rich. Unfortunately, they have a runtime license fee as well as quarterly reporting requirements (At least last year).
|
|
|
|
|
Do you happen to know what the pricing was on that? Just a ballpark figure.
Thanks
|
|
|
|
|
The Accusoft website. The pricing is, from what I remember, was around $1400 per developer and $8 per user for runtime royalities, plus annual maintenance.
|
|
|
|
|
Help me to get the memory details as u retrieve the hardware info.
If possible send the code
|
|
|
|
|
You can retirve hardware configuration information via WMI[^].
Here's some info on how to access it from C#:
C# WMI[^].
|
|
|
|
|
What is the use of having Dispose() method in class. All .NET classes are under managed code and garbage collection will be done automatically. But some classes like Dataset having dispose method. When we need to use dispose method for our class ? Writing dispose method for all classes is a good practice ?
|
|
|
|
|
Hello,
I often implement "IDisposable" with the Dispose method to unregister delegates to manager classes (classes which are allways in memory in my app) there.
All the best,
Martin
|
|
|
|
|
Thanks you. So if the code is 100% managed, do we need to implement this ?
|
|
|
|
|