|
Hi,
I m creating a treeview dynamically and saving the nodevalues as xmlfile ,now i want to save the whole xmlfile in a listbox instead of saving it in a .xml file.Can anyone help me for doing this??
|
|
|
|
|
|
I want to save Xml file inside a listbox or a textbox control...
|
|
|
|
|
why dont you try from javascript :
textfield.value
Listbox is not a good option for xml files.
Abhishek Sur
|
|
|
|
|
Hi
I have the Following code which opens a pdf that is stored in a sql database.
How do i attach the pdf to an email, or save the pdf to a temp folder, without openig the file.
void openPDF()
{
string sqlText = "SELECT PDF FROM tbObject WHERE ID = @ObjectID ";
SqlConnection connection = new SqlConnection(ConfigurationSettings.AppSettings["DbConnection"].ToString());
SqlCommand command = new SqlCommand(sqlText, connection);
command.Parameters.AddWithValue("@ObjectID ", Convert.ToInt32(Request["id"].ToString()));
connection.Open();
byte[] pdfData = (byte[])command.ExecuteScalar();
if (pdfData != null)
{
Response.ContentType = "application/pdf"; Response.AddHeader("content-length", pdfData.Length.ToString()); Response.AddHeader("content-disposition", "inline; filename=MyPDF.PDF");
Response.BinaryWrite(pdfData);
}
else
{
}
connection.Close();
}
Thanx Guyz
|
|
|
|
|
why dont you use:
FileStream ff = new FileStream("MyPDF.PDF", FileMode.Create);
ff.Write(pdfData, 0, pdfData.Length);
ff.close();
Abhishek Sur
|
|
|
|
|
Hi,
I have to take backup of the mysql database from the server to local machine database using asp.net 2.0. I have established the connection to the server database using the server name,username,password. Now i need to connect the local machine database. I have used the server name as 'localhost',username'root',pwd 'root'
But its not establishing the connection to the local machine when i upload the code in the server.
Can Anyone give me an idea how to connect to the local machine.
Thanks
|
|
|
|
|
sbua wrote: But its not establishing the connection to the local machine when i upload the code in the server.
um...
You're using localhost, because your DB is local to you, but you're running the code on the server ? Have I got it wrong, or is this a joke ?
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
Hi,
I tried to take the backup of mysql server database to my local database. I dont know how to do this.
Could you please give me an idea to implement this.
Thanks
|
|
|
|
|
Where is this ASP.NET application running? Server or your local machine? If it is on server, you are out of luck.
|
|
|
|
|
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........
|
|
|
|