|
In Windows Vista, the privilege of the application can limit many parts such as registry access etc.
Is there a way to set the provilege level to "Run this program as an administrator" when you click build in Visual Studio?
Thanks.
|
|
|
|
|
|
Greetings all! I am trying to run an UPDATE command on an XLS file that I have opened a connection to. However, the RunNonQuery() method throws the exception:
“No value given for one or more required parameters.”
ErrorCode -2147217904
Here is the code:
string connectionString = @"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=""C:\test.xls"";Extended Properties=""Excel 8.0;HDR=NO;""";
OleDbConnection con = new OleDbConnection(connectioinString);
con.Open();
OleDbCommand com = con.CreateCommand();
com.CommandText = "UPDATE [Sheet1$A1:A1] SET F1 = 'True'";
com.ExecuteNonQuery();
con.Close();
I’m pulling my hair out trying to figure out what I’m doing wrong… I was following the example from http://support.microsoft.com/kb/316934#12 to the letter, but I can’t figure out what I’m missing.
Can anyone point me in the right direction (or just let me know)?
Thank you all in advance!
|
|
|
|
|
Anticast wrote: com.CommandText = "UPDATE [Sheet1$A1:A1] SET F1 = 'True'";
why are you doing a range from A1 to A1?
try this
UPDATE [Sheet1$] SET A1 = 'True'
Yusuf
Oh didn't you notice, analogous to square roots, they recently introduced rectangular, circular, and diamond roots to determine the size of the corresponding shapes when given the area. Luc Pattyn[^]
|
|
|
|
|
Oh my... After running some trial and error testing by isolating each step I realized that my connection string had "HRD=NO" instead of the correct "HDR=NO"... so the connection was taking the first row as the header and that was causing the conflict.
For everyone else that may want to use this technique, it does work. If you want to read/write to cell B2 on worksheet MySheet you can use:
"SELECT * FROM [MySheet$B2:B2]"
"UPDATE [MySheet$B2:B2] SET F1 = 'Value'"
But you need to specify HDR=NO in the connection string.
See http://support.microsoft.com/kb/316934#12[^] for a step by step walkthrough.
Hope this helps someone.
|
|
|
|
|
Hi, Please help
I am new to programming. and I am trying to update a value in the database(ACCESS) with a value in a textbox on an ASP page.
the conditions are that "value" in database can only change if it is smaller than value in textbox in the ASP page.
I can INSERT, UPDATE, and DELETE values in the database from the ASP page. I just dont know how to write it with the "if" statement so that it can work
thanks for the help
|
|
|
|
|
daks906 wrote: I just dont know how to write it with the "if" statement
if( bMyCondition)
{
}
|
|
|
|
|
Below is the code i use to update the database. I just wanted to know how to write the code to UPDATE database value only if it is smaller than the value of the textbox on the ASP page
public void upOk_click(object sender, EventArgs e)
{
conn.Open();
OleDbCommand cmd = conn.CreateCommand();
cmd.CommandText = "UPDATE [Product]" +
"SET [CurrentBid]" + "='" + priceUpdate.Text + "'"
+
"WHERE [ProductID]=" + idDDL1.SelectedItem.Text;
cmd.ExecuteNonQuery();
DisplayTable();
}
|
|
|
|
|
why are you double posting? Didn't you ask the same question on the asp.net forum?
Yusuf
Oh didn't you notice, analogous to square roots, they recently introduced rectangular, circular, and diamond roots to determine the size of the corresponding shapes when given the area. Luc Pattyn[^]
|
|
|
|
|
Can anybody help me with the simplest code for playing a sine wave of 200hz using directsound. Runnable in Visual Studio 2008 with directsound as reference.
|
|
|
|
|
Hi,
of course. Here is the skeleton:
public class MySineWavePlayerUsingDirectSound {
public MySineWavePlayerUsingDirectSound() {
}
public void Play(...) {
}
}
So all that is left to do, is reading up on DirectSound and stuffing some code in the skeleton.
BTW don't forget to add the right references.
Luc Pattyn [Forum Guidelines] [My Articles]
- before you ask a question here, search CodeProject, then Google
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get
- use the code block button (PRE tags) to preserve formatting when showing multi-line code snippets
|
|
|
|
|
See this[^] article.
/ravi
|
|
|
|
|
Some applications, like WMP11 or Windows Live messenger, when resizing their window, instead of just having a minimum size or popping out scrollbars when the window gets too small, they seem to have some sort of prio list of which window controls to hide. Do they do this manually in code, or can this behaviour somehow be created via the window forms designer?
|
|
|
|
|
that takes code, it isn't even difficult. All it takes is modifying Bounds and Visible inside a Resize handler.
Luc Pattyn [Forum Guidelines] [My Articles]
- before you ask a question here, search CodeProject, then Google
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get
- use the code block button (PRE tags) to preserve formatting when showing multi-line code snippets
|
|
|
|
|
Hi everyone,
I have a datagridview with some columns of types textbox and combobox, the problem is, every time I build my application, the datagridview thinks it's smart and rearrange my columns for me which drives me crazy!!
Any way to stop that "smart" behavior??
Please help.
All generalizations are wrong, including this one!
(\ /)
(O.o)
(><)
|
|
|
|
|
specifically set the column order in code? i.e. call a function when the form loads or something similar
Life goes very fast. Tomorrow, today is already yesterday.
|
|
|
|
|
|
My dll file contains private key value. I used this key for encryption. How can I hide this key. If I use Reflector or other tool so show my code. I think obfuscation or post-build not guarantee hide my key value. I use strong key but, it can be remove using with Reflector plug-in. I add dll to GAC but, it easly to steal (Start --> Run ---> C:\windows\assembly\gac_msil).
Do you have any idea?
Best Regards...
|
|
|
|
|
hmmm. not quite sure. but i have just thought of something (maybe a little crazy but hey)
What about writting a small hardcoded algorithm that rearanges the key before using it for decryption/encryption? that way the stored 'key string' cannot be directly used by anybody else. unless of course they can get hold of your hardcoded algorithm. but that is harder than just getting the string, is it not?
instead of your own algorithm, maybe you could just use a hash value of the original key
What you think?
Life goes very fast. Tomorrow, today is already yesterday.
|
|
|
|
|
Dear Musefan;
First of all thanks for care. I have a algorithm like blowfish. I already written hardcoded this algorithm. But most important of this algorithmts need a key. This enuqe key is most important for this algorithm and it will be hide.
Thanks...
|
|
|
|
|
One thing Reflector doesn't show (AFAIK) is class-level fields. Since Reflector treats a const like a field, just put your key in a class-level static const. It can still be retrieved using custom-tailored reflection code, but it should deter casual hackers. I've done this in a private application, which uses a 256-length byte array to encrypt passwords; I couldn't retrieve the value using Reflector
|
|
|
|
|
Which program did you use for ? How can I put my key in a class-level static const.
Dotfuscator Community Edition is not convert variables.
Best Regards...
|
|
|
|
|
I didn't. However, on further analysis it turns out that the value is set from the static constructor of the class. Although it puts off casual crackers, it will not dissuade those who are determined to get the value. By class-level static const, I mean something like this:
internal class Program
{
internal static const string mySecretPassword = "Lorem";
}
However, it cannot compensate for a good obfuscation system and cannot stand on its own
modified on Wednesday, March 11, 2009 12:42 PM
|
|
|
|
|
In your sample not include identifier (for example string), so compiler get error. I try this;
internal class MyClass
{
internal static readonly string mySecretPassword1 = "MySecretKey";
private static readonly string mySecretPassword2 = "MySecretKey";
private const string mySecretPassword3 = "MySecretKey";
internal const string mySecretPassword4 = "MySecretKey";
private static string mySecretPassword5 = "MySecretKey";
internal static string mySecretPassword6 = "MySecretKey";
}
And obfuscation with Dotfuscator Community Edition and Salamander .NET obfuscator. And post build with Xenocode Postbuild 2008 for .NET. But I can see "MySecretKey" when I open obfuscated dll with reflector. In ".cctor()" function.
Note: In C#.NET
const = value assigned at Compile time and unchangeable once established.
readonly = value assigned at run time and unchangeable once established.
|
|
|
|
|
Whoops; I've added string to the code sample. As I said, all that my method does is hide it from a cursory look. It cannot compensate for a dedicated obfuscation package. I have chosen the const keyword because it simply provides safety in case I ever go past the ballmer peak and change its value; my choice was quite deliberate
|
|
|
|