|
Hi ,
Is there a way to change the table name of a datatable in a dataset or create a new dataset and copy the table with a new name in to the new dataset?
Jack Sparrow
--------------------------------------
Defeat is not the worst of failures. Not to have tried is the true failure.
|
|
|
|
|
Use below code and next time try to use Google
dataset.Tables[0].TableName = "MyTable1";
dataset.Tables[1].TableName = "MyTable2";
or do it in loop
for (int i = 0; i <= dataset.Tables.Count; i++)
{
dataset.Tables[i].TableName = "MyTable" + i.ToString();
}
|
|
|
|
|
Thanks mate, really not sure how I missed this...
Jack Sparrow
--------------------------------------
Defeat is not the worst of failures. Not to have tried is the true failure.
|
|
|
|
|
you are welcome
|
|
|
|
|
Here is the error:
System.Data.SqlClient.SqlException: Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding.
I receive this after ~32 seconds of running a SqlCommand. Now, normally the default timeout is 30 seconds, but I have increased this up to 10 minutes and still the timeout happens in 30 seconds. The connection string says Timeout=600 and I do not override this anywhere in the code. In fact, I can print the timeout prior to running the query and it says 600.
Am I missing something obvious here?
|
|
|
|
|
There are two different time outs for SQLConnection and SQLCommand.
Set longer timeout to the SqlCommand object (30 is default).
I hope if this helps
|
|
|
|
|
Also,
While declaring the command object set the timeout property 0 i.e. infinity.
SqlCommand cmd = new SqlCommand();
cmd.CommandTimeout=0;
Try this!
|
|
|
|
|
Very clever that you reply twice so I can give you two 5's
Answer is very much appreciated (with small modification)!
SqlCommand cmd = new SqlCommand();
cmd.CommandTimeout=con.ConnectionTimeout;
Now I can still modify the timeout just from the config file's connection string.
|
|
|
|
|
yes, dats better to keep config in scene!
i was in hurry to head towards home, so just didnt modify and took a new message post instead
|
|
|
|
|
You're setting the timeout on the CONNECTION attempt, not the query execution timeout. You do that in the SqlCommand object you're using to execute your query.
|
|
|
|
|
We have an ASP.NET 3.5 site that uses themes and skins for handling css and images. Now we are about to create a new site that should have a common look and feel and I like to share the App_Themes between the sites so that they always will have the same look.
Anyone that have any experience in this topic?
_____________________________
...and justice for all
|
|
|
|
|
Answer is Global Themes
A global theme is a theme that you can apply to all websites on a server. They are much alike to Page themes except that their scope is set at server level.
we need to add <pages> element with Theme attribute in Machine.config file which defines global theme for whole server.
*- Google for more information and implementation.
|
|
|
|
|
Interesting! Do you have practical experience in how this is set up with projects in Visual Studio. Most developers should not have to bother about styles and images but need to be able to run the whole site locally.
_____________________________
...and justice for all
|
|
|
|
|
This is C# Forum so I Recommend you to move your question to ASP.net Forum for better response.
modified on Wednesday, December 29, 2010 10:46 PM
|
|
|
|
|
Can I restrict or block access to a specific registry key in HKLM?
Or maybe hook it so that another process cannot read it?
My goal is to temporarily block/obscure access to an HKLM registry key by the winlogon process, remotely.
Thanks!
|
|
|
|
|
|
Sounds like somebody is trying to hack some software , but you can set permissions on registry keys.
|
|
|
|
|
The only way to do that would be to setup permissions on that key preventing the user from reading it.
You can NOT prevent WinLogon from reading it's values. Why? Because even Windows has to login to itself! Various accounts, including Local System and service accounts, need access to WinLogon to execute.
I cannot think of a single reason why you would want to do this.
|
|
|
|
|
I will give you a single reason
I want to write a remote desktop application with the ability to stop the legal banner from popping up therefore not requiring user action before the login/password/domain are sent, because that hoses the entire process since that window handle cannot be identified (because the contents are encrypted) I cannot close that legal banner pop up window ... however if I can stop it from opening then the result is the same.
|
|
|
|
|
You might want to check with your legal department first. You might not get away with circumventing that little screen, as annoying as it is.
|
|
|
|
|
If I can figure out how to do it, I will then ask ... no point in asking ahead of time if I can't do it.
Any idea how to do the block?
|
|
|
|
|
That's ass end backwards. Is there any reason to waste time researching how to do this if your legal department tells you that you can't do it? You're just costing your company money here.
|
|
|
|
|
If you have another way to do this, I am all ears
|
|
|
|
|
Sure, you just have to add Deny permissions to the SYSTEM account to key immediately above what you want to block.
I'd open regedit first, try setting this by hand yourself, and then see what happens. You may not be able to reverse what you've done. That being the case, I highly suggest trying this on a virtual machine or a machine you don't care about rebuilding.
Since WinLogon is also responsbile for loading the User Profile, you may get the ability to skip the legal screen, but lose the ability to completely login to the machine. You may also never get a shell, and you may lose all network connectivity to off-machine resources, such as network shares, ..., among other things...
Do you still think this is a good idea?? I know I wouldn't consider it a supportable solution in an Enterprise environment, or any other environment for that matter.
|
|
|
|
|
Since RDP encrypts the window and no one seems to have cracked that, I'm not sure if there is another solution besides this one?
I'd much rather go the route of decrypting the window contents, looking for the legal banner window handle to appear and sending an enter key to that the moment it appears, but I'm not even sure that is possible.
I'm all ears if anyone has any other ideas ...
|
|
|
|