|
Dim cmd As DbCommand
Dim str As String = "Backup Database " & "Mydatabase" & " To Disk = '" & 'C:\Documents and Settings\Dotnetuser\Desktop\bkdatabase' & "'"
cmd = db.GetSqlStringCommand(str)
db.ExecuteNonQuery(cmd)
I face problems "Time Out Expired and server is not responding"
|
|
|
|
|
Did u specify the backup filename (backup.bak) in the destination directory?
The name is Sandeep
|
|
|
|
|
You can find a sample code snippet here[^]
Steve Jowett
-------------------------
Sometimes a man who deserves to be looked down upon because he is a fool, is only despised only because he is an 'I.T. Consultant'
|
|
|
|
|
I need some help regarding the creation of control instances during runtime of an application. For eg: I have a tabcontrol with only one tab, and a textbox in that single tab. When I click a 'NEW' button, a new tab must be created in the control AND along with that I want a new text box in the latest tab. I am using VB
Thnx for any help...
The name is Sandeep
|
|
|
|
|
The textbox needs to be added to the tab control's controls collection, and the tab page is added to the tab controls collection of tab pages.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Hello Christian,
Thnx for your suggestion. But can you explain it? I understood what you said, but still didnt get how to do it. I hope you have not forgotten that I'm using VB.
The name is Sandeep
|
|
|
|
|
Add the control you created to the forms Controls collection:
Dim tb As New TextBox
tb.Location = ...
tb.Size = ...
Me.Controls.Add(tb)
For the tab page, you add it to the TabControl's Controls collection.
|
|
|
|
|
Adding an control at runtime
The following routine adds the Email label and associated text box at run time.
Private Sub AddEmailAddress()
Dim txtEmail As New TextBox
Dim lblEmail As New Label
' Set the desired properties
txtEmail.Top = txtAddress.Top + txtAddress.Height + 10
txtEmail.Left = txtAddress.Left
lblEmail.Text = "Email"
lblEmail.Location = New Point(lblAddress.Location.X, _
txtEmail.Location.Y)
' Add to the collection
txtAddress.Controls.Add(txtEmail)
txtAddress.Controls.Add(lblEmail)
End Sub
The above is adopted from MSDN. When you are creating controls at runtime you need to add event handlers in runtime also..
Read the following topic..
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dv_vstechart/html/controlarrays.asp
|
|
|
|
|
Why are you telling me this? Tell the original poster! That way, he'll get a message that you replied instead of me. I already know how to do this stuff...
|
|
|
|
|
obviously u must be knowing dave...
this is code is not for you.
yeah by mistake i replied your post...
|
|
|
|
|
Hey:
I have my data in two dimensional arrays. I want to display those data in Datagrid. Can anybody guide me how can I do this?
hsprasain
|
|
|
|
|
Hopr the Article by Mihail Stefanov here[^] in CP will Help you.
Regards,
Satips.
|
|
|
|
|
I need to slove my problem in VB.NET not in C#
|
|
|
|
|
The article supplied contains a library that will create a proper datasource from a multi-dimensional array. Just download the .dll and add a reference to it. You can then use it like this:
Dim test(2, 2) As String
test(0, 1) = "SomeData"
test(0, 2) = "SomeOtherData"
DataGridView1.DataSource = New Mommo.Data.ArrayDataView(test)
|
|
|
|
|
Thanks a lot!! It worked well for me.
|
|
|
|
|
I have given the Idea with the help of that article.
I cannot do your work.
Please do the work and if there is any problem we can guide you.
Regards,
Satips.
|
|
|
|
|
The code is easily convetible to VB.NET.
If you want a translation guide, all you have to do is look in the documentation on MSDN. Nearly every single code sample for any class, method, or property, comes written in VB.NET and C#. All you have to do is compare the two to learn the syntax.
|
|
|
|
|
Am using a tabcontrol for an app. 1 of these tab pages contains code which needs to be executed but not before that particular tab page is fully visible. Problem I'm facing now is that this code (which is in the Enter event of that tab page) is executed basically inbetween switching from tab1 to tab2. Is there a way to check if a tabpage or a particular control is really visible on screen?
|
|
|
|
|
It has a Visible property, is this not working as you'd hope ?
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
No, the Visible property already results to "True" even if the tabpage hasn't been complete finished displaying.
|
|
|
|
|
Mickey01 wrote: of these tab pages contains code which needs to be executed but not before that particular tab page is fully visible.
Why is that?
It sounds like it has something to do with the actual display of the tab page, and in that case it should be done in a Paint event. There might be other windows partly covering your window, so even if the tab page is visible, it might not be fully visible, and if you don't handle this in a Paint event, you don't know which parts are visible.
---
single minded; short sighted; long gone;
|
|
|
|
|
The 2nd tabpage contains some code which takes a bit of time. I want that tabpage displayed completely before that code starts. This tabpage contains information for the user of "how / what" is happening. There is no overlap of any other controls.
Let's say this tab page contains a label called "lblUserinfo" which contains a bit of informative text for the end user. I want the code not to start before that label is actually being displayed.
|
|
|
|
|
Mickey01 wrote: The 2nd tabpage contains some code which takes a bit of time. I want that tabpage displayed completely before that code starts.
I don't like doing this, but have you tried sticking a Application.DoEvents() at the beginning of your "long running" code?
Normally, I'd be running all the code to setup the controls of every tab of a tabcontrol before I let the user see it. You treat all the tabs of a tabcontrol as a single control and not on a per-tab basis.
For instance, an options dialog with multiple tab pages gets and sets the values for all the controls on every tab page when the dialog is shown, NOT when each tab is shown. When the changes are done being made, the dialog writes all the values, on every tab page, back to persisted storgage and applies all the changes to running code when the dialog is dismissed. It doesn't do this when changing tab pages.
|
|
|
|
|
Controls are created prior to running the code. I'm just wondering if there is a way to actually check if a control is visible to the user. Just using control.visible() will result in True but that doesn't mean the user already sees the control.
|
|
|
|
|
Mickey01 wrote: Controls are created prior to running the code. I'm just wondering if there is a way to actually check if a control is visible to the user.
No, there isn't.
|
|
|
|