|
how do i delete the selected node programmatically in tree view?
|
|
|
|
|
<br />
treeview.Nodes.Remove(treeView.SelectedNode);
|
|
|
|
|
Hi All
Last Mounth I Creat BackUp DataBase From Microsoft SQl Server 2005 By C#.Net Code .
But Know I Wount To Restor This BackUp From Device To Microfoft SQL Server 2005 By C#.Net Code .
Who Can Hellp Me By Support me By C#.Net Code ?
Thanks For Any Body Hellp me
Thaer
|
|
|
|
|
using Microsoft.SqlServer.Management.Smo;<br />
private static Server srvSql;<br />
private static ServerConnection srvConn;<br />
Coeenction
<br />
servername = cmbServer.Text;<br />
srvConn = new ServerConnection(cmbServer.SelectedItem.ToString());<br />
srvConn.LoginSecure = true;<br />
<br />
srvSql = new Server(srvConn);<br />
//Restoring Database
void Restoring_data()<br />
{<br />
<br />
if (srvSql != null)<br />
{<br />
<br />
Restore rstDatabase = new Restore();<br />
rstDatabase.Action = RestoreActionType.Database;<br />
rstDatabase.Database = "DataBaseName"<br />
BackupDeviceItem bkpDevice = new BackupDeviceItem(txtbackup.Text.ToString(), DeviceType.File);<br />
rstDatabase.Devices.Add(bkpDevice);<br />
rstDatabase.ReplaceDatabase = true;<br />
<br />
rstDatabase.SqlRestore(srvSql);<br />
<br />
}<br />
else<br />
{<br />
MessageBox.Show("A connection to a SQL server was not established.", "Not Connected to Server", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);<br />
}
Hope this will help your
|
|
|
|
|
Thanks Mr Abhijit Jana
but this code have Exeption
Nicrosof.SqlServer.Management.smo.PropertyNotSetExeption,
Set Property Device to Accomplish this action
And this Exeption wount
RestData.script(server);
I Dont What is the Problem for this Problem if you can hellp me
Thaer
|
|
|
|
|
How to pass session value in javascript
help me with code
thanx in advance
|
|
|
|
|
post it on Asp.net Forum !!!
|
|
|
|
|
hi i want to add , delete an modify axml file directly from tree view
i have done some code to access it , but i am not getting how to add an modify n delete a node directy
.
code:
private void Form1_Load(object sender, System.EventArgs e)
{
// Initialize the controls and the form.
label1.Text = "File Path";
label1.SetBounds(8, 8, 50, 20);
textBox1.Text = Application.StartupPath + "\\Sample.xml";
textBox1.SetBounds(64, 8, 256, 20);
button1.Text = "Populate the TreeView with XML";
button1.SetBounds(8, 40, 200, 20);
this.Text = "TreeView control from XML";
this.Width = 336;
this.Height = 368;
treeView1.SetBounds(8, 72, 312, 264);
}
private void button1_Click(object sender, System.EventArgs e)
{
try
{
// SECTION 1. Create a DOM Document and load the XML data into it.
XmlDocument dom = new XmlDocument();
dom.Load(textBox1.Text);
// SECTION 2. Initialize the TreeView control.
treeView1.Nodes.Clear();
treeView1.Nodes.Add(new TreeNode(dom.DocumentElement.Name));
TreeNode tNode = new TreeNode();
tNode = treeView1.Nodes[0];
// SECTION 3. Populate the TreeView with the DOM nodes.
AddNode(dom.DocumentElement, tNode);
treeView1.ExpandAll();
}
catch(XmlException xmlEx)
{
MessageBox.Show(xmlEx.Message);
}
catch(Exception ex)
{
MessageBox.Show(ex.Message);
}
}
private void AddNode(XmlNode inXmlNode, TreeNode inTreeNode)
{
XmlNode xNode;
TreeNode tNode;
XmlNodeList nodeList;
int i;
// Loop through the XML nodes until the leaf is reached.
// Add the nodes to the TreeView during the looping process.
if (inXmlNode.HasChildNodes)
{
nodeList = inXmlNode.ChildNodes;
for(i = 0; i<=nodeList.Count - 1; i++)
{
xNode = inXmlNode.ChildNodes[i];
inTreeNode.Nodes.Add(new TreeNode(xNode.Name));
tNode = inTreeNode.Nodes[i];
AddNode(xNode, tNode);
}
}
else
{
// Here you need to pull the data from the XmlNode based on the
// type of node, whether attribute values are required, and so forth.
inTreeNode.Text = (inXmlNode.OuterXml).Trim();
}
}
plz help me . or send me an pprom on manasvi.s.s@gmail.com
|
|
|
|
|
Have you come up with any good ideas?
"I guess it's what separates the professionals from the drag and drop, girly wirly, namby pamby, wishy washy, can't code for crap types." - Pete O'Hanlon
|
|
|
|
|
I am getting an exception as System.InvalidOperationException,
Additional Info: It is invalid to start a second message loop on a single thread. Use application.RunDialog or Form.ShowDialog.
My code is:
class cINI
{
[STAThread]
static void Main()
{
InitApp();
}
private static void InitApp
{
frmFirst obj = new frmFirst();
obj.ShowDialog();
}
internal static void StartApp()
{
clsLogin = new cLogin(dbUtils);
if(clsLogin.ShowLogin() == DialogResult.Ok)
Application.Run(new frmMain());
}
}
Now the frmFirst :
Here On Button click event i want to call the StartApp method, so i write
cINI.StartApp();
|
|
|
|
|
Check out this article[^] and see how the form (splash screen) is run on a seperate thread.
|
|
|
|
|
HI
when we are refreshing the page previous value is going and new
value is assiging
for ex: a[0]=34;
a[1]=0;
a[2]=0;
when we are working and page is refreshed and assigned a[1]=23;
now a[0]=0;
a[1]=23;
a[2]=0;
can any one help how to store all the values like
a[0]=34;
a[1]=23;
................
Thanx in advance
suman.c
|
|
|
|
|
You need to realise that every time your page posts back the request is handled by a completely new instance of your page class. This means that your Hashtable field will be initialized every time.
Read up on the ASP.Net Page Lifecycle.
If you want to keep information between requests then you can store the data in a few places. Have a read up on the ViewState, Session and Application objects.
|
|
|
|
|
Hi every body , i want to Delete a .wav file from linux directory '/var/spool/asterisk/monitor/20080122-182544-1201006544.4.wav' from windows machine using c#.net, can any body write me some code related to this.
|
|
|
|
|
Unless you get your network admin to comprimise the entire security of the linux box, this is definately not possible from C#, neither will it be even if you are non-root on the linux box itself.
|
|
|
|
|
is it possible with any other developing way to delete file. e.g. telnet c#,ssh c#.net code or any other developing code.?
|
|
|
|
|
Can you get to the file via normal means ie putty or a mapped network drive?
C# isn't going to get you access to the box that you don't have using other techniques.
Russell
|
|
|
|
|
1. When does this exception occur “Index out of range”?
a. Opening a database connection
b. On datatype mismatch
c. On accessing a data column not existing
d. When dead lock occurs
2. Which of the following object is used to catch a run time error?
a. Runtime.error
b. Exception.InnerException
c. Err
d. Error.runtime
3.What does WSDL stand for?
a. Web service Dynamic Language
b. World Service Data Language
c. Web service Design Language
d. Web service Description Language
4.Event supported by Dropdownlist
a. OnKeyup
b. OnKeypress
c. OnChecked
d. OnDatabound
5. Namespace used to connect SQL Server 2000 database
a. System.Oledb.SqlServer
b. System.Odbc.SqlClient
c. System.data.SqlClient
d. System.data.SqlServer
6. How to generate a javascript code at run time?
a. Page.RegisterClientScriptBlock()
b. Page.RegisterClientScript()
c. Page.RegisterScriptBlock()
d. Page.RegisterScript()
7. How many script tag can a .net page can have?
a. 5
b. 10
c. 20
d. Unlimited
8. Most efficient way of concatenating two strings
a. String1.Concat(String2)
b. String1 & String2
c. Concat(String1,String2)
d. StringBuilder.Append(String1).Appent(String2)
9. Choose odd one out
a. DataSet
b. DataTable
c. DataReader
d. DataAdapter
10. How to access a value from Web.config?
a. Configuration.AppSettings()
b. ConfigurationManager.AppSettings()
c. Configuration.Settings.AppSettings()
d. Configuration.App.Settings()
11. How to assign a javascript event to a asp.net button control?
a. Button.AssignScript(“onClick”)
b. Button.Attributes.onClick()
c. Button.Attributes.Add(“onclick”)
d. Button.Attributes.AddScript(“Onclick”)
12. If Session.timeout=30. When will the session expire?
a. 30 Milliseconds
b. 30 Minutes
c. 30 Seconds
d. 30 Hours
13. Which of the following method transfers control from one page to another and preservers the form values in the first page.
a. Server.Transfer()
b. Response.Redirect()
c. Request.Show()
d. Request.Display()
14. A Web service can only be written in .NET?
a. True
b. False
15. A set of tables are maintained in a Dataset as
a. TablesCollection object
b. DataTableCollection object
c. DataRowsCollection object
d. TableRowCollection object
plz help....
|
|
|
|
|
You forgot,
16. How does a student learn C#:
a. Ask people to do his/her homework.
b. Programming is stupid, I'd rather be a movie star.
c. He/she takes the initiative and does a few simple google searches.
d. Learn to write and even speak in native binary, C# is bound to be easier then...
|
|
|
|
|
Answer of Question 1
(from your options)
c. On accessing a data column not existing
in general this exception occurs when someone try to access the index an array that is outside the bounds of the array.
Answer of Question 2
None of the mentioned choices..
Answer of Question 3
None of the mentioned choices..
Answer of Question 4
a,b
Answer of Question 5
c
Answer of Question 6
None of the above
Page.ClientPage.RegisterClientScriptBlock() //Check this.
Answer of Question 7
Not sure
Answer of Question 8
StringBuilder.Append
Answer of Question 9
c
Answer of Question 10
c
Answer of Question 11
c
Answer of Question 12
30 Minutes (not sure)
Answer of Question 13
Server.Transfer (again google about it)
Answer of Question 14
False
Answer of Question 15
b
AND THE ANSWER TO ALL THESE QUESTIONS IN ONE WORD "GOOGLE"
|
|
|
|
|
http:\\www.google.com
|
|
|
|
|
1. Neither
2. Neither
4. Neither
6. Neither
8. Neither
Experience is the sum of all the mistakes you have done.
|
|
|
|
|
No wonder so many people passing software courses nowadays...
|
|
|
|
|
Can anybody help me getting the "CrystalRuntime.Application",
i am new to crystel report .. i am converting some VB code in to C#
but i dont know how to convert following code...
Dim vorep As New CRAXDRT.REPORT
If avoA Is Nothing Then
Set avoA = CreateObject("CrystalRuntime.Application")
End If
Set vorep = avoA .OpenReport(Report)
vorep.EnableParameterPrompting = False
If vorep.HasSavedData Then
vorep.DiscardSavedData
End If
can anybody help me here....
T@SU
|
|
|
|
|
Any one know how to create an airbrush drawing tool.
|
|
|
|