|
Hi,
Asp.net application is running in the server. How to take my server db backup to the local machine
Thanks
|
|
|
|
|
You have no idea about how things works. How are you expecting the application running on a remote server can communicate with your local machine?
|
|
|
|
|
This is a tricky question. You can use wscript to run shell commands and get this done.
Dim oShell
Set oShell = CreateObject("WScript.Shell")
oShell.run "cmd /C " & strMYLocation & "mysqldump -B " & dbname & " -u " & strMYUser & " -p" & strMYpassword & " > " & strMYBackup & "dbBkup" & strBackup & dbname & ".sql",,true
Set oShell = Nothing
Make sure to grant read/execute/write permissions to the IUSR account over all the involved files and folders. Good luck!
Ranjit Viswakumar
Professional Services Specialist
http://hostmysite.com/?utm_source=bb
|
|
|
|
|
I want promt to collect information and assign it to a string varible in C#. How can this be possible
|
|
|
|
|
The most common way to pass a variable from js to C# is to write it to a hidden field.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
How do you create a hidden field?
|
|
|
|
|
<asp:hiddenfield xmlns:asp="#unknown">
or just
Abhishek Sur
|
|
|
|
|
Can you explain more.
Whats you'r source information?From control?
sepel
|
|
|
|
|
|
To recap
1 - the code is out there, easy to find with google
2 - if you can't understand it, you won't understand anything we give you
3 - if this is paid work, you are a disgrace, if it's a project, talk to your teacher. If it's for fun, buy a book and start more slowly
4 - don't crosspost.
Oh. and I think if I ran a poll, most people would agree with me that it is not urgent at all.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
Hello Friends,
I've a GridView in which i've taken a LinkButton as TemplateField and that's CommandName is "Play". And now i want to print the index value of the row accordingly the Play button of the GridView's row is clicked.
protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
{
if (e.CommandName == "Play")
{
int index = Convert.ToInt32(e.CommandArgument);
Response.Write(index);
}
}
And i'm getting an error Input string was not in a correct format"
|
|
|
|
|
.NET- India wrote: int index = Convert.ToInt32(e.CommandArgument);
Response.Write(index);
1 - why do you need to convert this to an int to write it ?
2 - your error probably means the input was not an int, which is why you should never use Convert.ToInt32 ( use int.TryParse )
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
Actually sir i'm getting error because there is no value in e.CommandName i mean it holds null. But why i'm not getting value please let me know
|
|
|
|
|
You may not assign any value to you'r LinkButton. And it can't Convert Null to int32.
sepel
|
|
|
|
|
I have a web application where im using
WMI connection through asp.net from Computer A(Windows XP) to Computer B(Windows 2003 Server..).
the code is as follows...(and the below code works if the operating systems in both the systems are same otherwise it"s not working...)
ConnectionOptions options = new ConnectionOptions();
options.Username =username;
options.Password = password;
string machinename = "*******";
// Read registry of remote machine....
ManagementScope myScope = new ManagementScope("\\\\" + machinename + "\\root\\default", options);
myScope.Options.EnablePrivileges = true;
myScope.Options.Impersonation = ImpersonationLevel.Impersonate;myScope.Options.Authentication = AuthenticationLevel.Packet;
myScope.Connect();
and the error is ...
Server Error in '/' Application.
--------------------------------------------------------------------------------
The RPC server is unavailable. (Exception from HRESULT: 0x800706BA)
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Runtime.InteropServices.COMException: The RPC server is unavailable. (Exception from HRESULT: 0x800706BA)
Source Error:
Line 77: myScope.Options.Authentication = AuthenticationLevel.Packet;
Line 78: mySearcher = new ManagementObjectSearcher(myScope, myQuery);
Line 79: myScope.Connect();
Line 80: //myQueryCollection = mySearcher.Get();
Line 81:
Source File: D:\Tools Validator\Skywebadmin\Skywebadmin\WebForm6.aspx.cs Line: 79
Stack Trace:
[COMException (0x800706ba): The RPC server is unavailable. (Exception from HRESULT: 0x800706BA)]
System.Runtime.InteropServices.Marshal.ThrowExceptionForHRInternal(Int32 errorCode, IntPtr errorInfo) +0
System.Management.ManagementScope.InitializeGuts(Object o) +783
System.Management.ManagementScope.Initialize() +216
System.Management.ManagementScope.Connect() +5
Skywebadmin.WebForm6.Button1_Click(Object sender, EventArgs e) in D:\Tools Validator\Skywebadmin\Skywebadmin\WebForm6.aspx.cs:79
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +105
System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +107
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +7
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +11
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +5102
--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:2.0.50727.42; ASP.NET Version:2.0.50727.42
RPC ,WMI were running in both systems even windows firewall is off....
Please help me out........
|
|
|
|
|
Hi All
Im using VS.NET 2005 for web application,and there im using 3 diffenet lanuages french, dutch and english.also im having dropdown and there im load some Quantity and other dropdown will load some decima values, when i change the lanuage all value change according to lanuage so when i passed that value to database it is not giving any result becous, all the decimal value change as comma
Example-
Decimals
In English-50.50
In France- 50,50
In Ducth -50,50
Quantity
In English-50
In France- 50,00
In Ducth -50,00
So this is the problem, i need to passed exact value to database, pls help me to solve this problem.
Thanks
|
|
|
|
|
You need to write code that is localisation aware in all ways. Which means you need to work out the number format for each locale, and either sanitise it, or make your DB able to handle it
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
Hello everyone,
Previously my ASP.Net web application connects to database directly using ASO.Net. Now I want to change it to 3 layers, ASP.Net layer, middle web service layer and backend database layer. I think there is benefit that I could abstract data source to ASP.Net front layer, loosely coupled and reduce potential security risks to let external exposed ASP.Net web application to be able to access database directly, etc.
Compared with 2 layer architecture with the 3 layer architecture, I met with 2 major issues.
1. An additional middle web service layer will incur more traffic, e.g. ASP.Net does not talks to database direclty, but talks to web service and web service talks to database, will incur more traffic. Will it be a bottleneck? Any general advice to solve this issue if it is a bottleneck?
2. Since ASP.Net can not connect to database but connect to web service, it can not get DataSet/DataTable object easily. It becomes hard to present table form data to data bound controls. Any ideas to make presentation layer in ASP.Net easier coding?
regards,
George
|
|
|
|
|
1 - Separating the data access to web service make sense for stand-alone applications as it will be distributed to client machines. You can do changes to the WS without redeploying application. But in ASP.NET, since everything is in server, you don't need a WS for data access. You can do it in separate project and refer the assembly in your ASP.NET project.
2 - Personally, I don't prefer using DataSet or DataTable. Use strongly typed DTOs. It will help you to produce clean code.
|
|
|
|
|
Thanks Navaneeth!
1.
I am planning to develop client side application, and it is another reason why I want to provide an additional web service layer. Any comments?
2.
"You can do it in separate project and refer the assembly in your ASP.NET project." -- in the future, I may introduct cache server and file based server, and I want to use a middle layer web service to transparent the data source differences to ASP.Net layer. Any comments? Does such design make senses?
2.
"Use strongly typed DTOs. It will help you to produce clean code." -- never heard of this method before but intersted, could you show more description or recommend some documents please?
regards,
George
|
|
|
|
|
George_George wrote: I am planning to develop client side application, and it is another reason why I want to provide an additional web service layer. Any comments?
If it is as a stand-alone application, abstracting data access on WS is good. You could also consider WCF.
George_George wrote: Does such design make senses?
Sounds like provider pattern to me.
DTO is Data Transfer Object. Read about it here[^].
|
|
|
|
|
See Data Transfer Object[^].
Of one Essence is the human race
thus has Creation put the base
One Limb impacted is sufficient
For all Others to feel the Mace
(Saadi )
|
|
|
|
|
George_George wrote: Since ASP.Net can not connect to database but connect to web service, it can not get DataSet/DataTable object easily
What on earth are you talking about ? I connect to databases in ASP.NET all the time, and have returned DataTables, depending on the project I worked on, and what they preferred to do.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
Hi Christian,
My concern is,
1. If database schema changes, I have to change ASP.Net code. Using an additional web service layer could make change of database schema transparent to ASP.Net code;
2. I am concerning about using ASP.Net to connect to database is not very secure.
Any comments?
regards,
George
|
|
|
|
|
George_George wrote: If database schema changes, I have to change ASP.Net code
If your database schema changes, you need to change your webservice, too. How often does this happen ?
George_George wrote: I am concerning about using ASP.Net to connect to database is not very secure.
What on earth makes you think that ?
Just to clarify, I assume you're talking about a data layer that connects to a SQL database, not having SQL in your presentation layer, right ?
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|