|
yes that's what i mean
i wanna to update 2 tables with one command
|
|
|
|
|
You can't do it within one statement. You can send 2 different statements in one command by putting a semi-colon between them.
Another option is to create a trigger that will update the other table for you in sql server itself...
|
|
|
|
|
Hi Friends
I am Bala from Srilanka
New Member
I have the problem to Take the backup from sql server 2000 & 2005 through vb6. Please Sent the coding
Bala
K.Balakumar
|
|
|
|
|
I've never done the database backup thought code. What we used to do is that we create a job for backing up the database or we did manually.
As this article Perform an MSDE database backup through Transact-SQL mentions, you can create a job in SQL database by using this T-SQL script~
USE msdb<br />
EXEC sp_add_job @job_name = 'BackupJob',<br />
@enabled = 1,<br />
@description = 'BackupJob',<br />
@owner_login_name = 'sa',<br />
@notify_level_eventlog = 2,<br />
@notify_level_email = 2,<br />
@notify_level_netsend =2,<br />
@notify_level_page = 2<br />
@notify_email_operator_name = 'myMailAddress'<br />
go<br />
-- Data backup<br />
USE msdb<br />
EXEC sp_add_jobstep @job_name = 'BackupJob',<br />
@step_name = 'msdb database backup',<br />
@subsystem = 'TSQL',<br />
@command = 'BACKUP DATABASE msdb TO DISK = ''c:\msdb.dat_bak''',<br />
@on_success_action = 3,<br />
@retry_attempts = 5,<br />
@retry_interval = 5<br />
go<br />
-- Log file backup<br />
USE msdb<br />
EXEC sp_add_jobstep @job_name = 'myTestBackupJob',<br />
@step_name = 'msdb Log backup',<br />
@subsystem = 'TSQL',<br />
@command = 'BACKUP LOG msdb TO DISK = ''c:\msdb.log_bak''',<br />
@on_success_action = 1,<br />
@retry_attempts = 5,<br />
@retry_interval = 5<br />
go<br />
-- Server specification<br />
USE msdb<br />
EXEC sp_add_jobserver @job_name = 'BackupJob', @server_name = N'(local)'<br />
<br />
-- Immediate job execution<br />
USE msdb<br />
EXEC sp_start_job @job_name = 'myTestBackupJob'
then, execute the following code thought VB6.
OSQL -Usa -P -i BackupJob.sql -n
OR ~
You may try to use "SQL/DMO object library" in VB6 application.
http://www.freevbcode.com/ShowCode.asp?ID=2579[^]
Thanks and Regards,
Michael Sync ( Blog: http://michaelsync.net)
If you want to thank me for my help, please vote my message by clicking one of numbers beside "Rate this message". Why vote? Plz Read it here. Thank you.
|
|
|
|
|
Dear friends,
I would like to see two different highlight colors in word when user executes a macro.
Please help me!
thanks,
|
|
|
|
|
hello frnds,
i am using VB.Net 2.0 and i have some groups in my active directory,
i am able to share a directory/folder programatically but unable to add the groups in that sharing
please any one help me...
any link / code ??
thankx in advance
koolprasad2003
Be a good listener...Because Opprtunity knoughts softly...N-Joy
|
|
|
|
|
how to direct from 1form to another form & when i try to connected to Database the following error msg displays
"username not found"
the code
str ="username=hasitha;password=randika;databasemike;server=suntwo"
hello
|
|
|
|
|
how to direct from 1form to another form & when i try to connected to Database the following error msg displays
"username not found"
i think you are open particular user detail from form1 and show this detail to another form (form2). you can make a procedure on form2 which take UserID as argument and then basis on this UserID you can write query.call this procedure from Form1 and at this moment if user exist then load form2 otherwise dont transter focus to form2
the code
str ="username=hasitha;password=randika;databasemike;server=suntwo"
what is this ? i think it is connectionstring. Please look at database argument.
hope this helps
Rupesh Kumar Swami
Software Engineer,
Integrated Solution,
Bikaner (India)
|
|
|
|
|
1 - try giving your subject some meaning
2 - try explaining your self a little more. The code you posted means nothing, except that I now know how to hack into your DB. The error does not come from this line, so where does it come from ?
3 - it sounds to me like you're usng online help to work on the edge of your skillset. Try reading through some books, so you understand basics like how to work with more than one form
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 )
|
|
|
|
|
Error in your connectionstring statement, correct that, see this.
server=servername;database=DatabaseName;uid=UserName;pwd=Password.
Bhaskar Shetty
|
|
|
|
|
|
i am using vb .net 2005
is there a way to make datagridview readonly property become false when we bind a datagridview with datatable ??
|
|
|
|
|
aphei wrote: a way to make datagridview readonly property become false
What wrong with this code? DataGrid1.ReadOnly = false;
Thanks and Regards,
Michael Sync ( Blog: http://michaelsync.net)
If you want to thank me for my help, please vote my message by clicking one of numbers beside "Rate this message". Why vote? Plz Read it here. Thank you.
|
|
|
|
|
that's nothing wrong with that script.
but i still can't edit the columns.
when i write "datagrid1.Columns.Item(0).ReadOnly = False"
it become error
how can i edit my datagrid when i bind it?? thank's
-- modified at 2:22 Tuesday 21st August, 2007
|
|
|
|
|
You should able to edit the columns after you bind it, you can't set datagrid's single column to read-only.
Check the Datagrid Read only property, It should be false.
Bhaskar Shetty
|
|
|
|
|
thanks Bhaskar Shetty. your answer is help me very much.
|
|
|
|
|
You can only change a bound DataGridView Cell's value if it's underlying Data Field is NOT Read Only.
Make sure that you are using a DataSource that can be updated.
Tom Garth
Developer
R. L. Nelson and Associates, Inc., Virginia
|
|
|
|
|
thanks Tom.. your answer is help me very much..
|
|
|
|
|
How I can bind the textbox and datacombo controls at rum time?
I am using treeview to show the products.
For example:-
when user click on any product from the treeview it should display the other fields in the textboxes and datacombo.
Can any body help me how to bind the textbox and other controls at run time?
Thanks in advance
Ejaz
|
|
|
|
|
bind is the wrong word. You handle the selected item changed event on the tree view, and then you write code to read the other information you require and shove it into the textboxes. runtime is the only time you can do this, or do you mean to define the rules as to what text goes where, at runtime ?
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,
I have an a button on a form, the button has an image set at design time.
if certain conditions are met i would like to change the image on this button to a different image.
both images in question are loaded as an application resource and appear as an image in the resources (My.resources.).
I tried going the route of:
if "condition met" then
me.btnX.image = my.resources.image2
end if
this does not work!
any thoughts would be appreciated.
Thanks!
|
|
|
|
|
private void button1_Click(object sender, EventArgs e)<br />
{<br />
pictureBox1.Image = WindowsApplication5.Properties.Resources.image2;<br />
}
I have tried with BMP image. It works fine.
Thanks and Regards,
Michael Sync ( Blog: http://michaelsync.net)
If you want to thank me for my help, please vote my message by clicking one of numbers beside "Rate this message". Why vote? Plz Read it here. Thank you.
|
|
|
|
|
- The image is loaded into a button (not a picture box)
- I am also coding in VB.Net VS2005, so to access the image in resources i refrence it as follows:
My.Resources.ImageName
The reference you listed:
WindowsApplication5.Properties.Resources... is not in vs2005
Can any one help?
-- modified at 16:42 Tuesday 21st August, 2007
|
|
|
|
|
rnamro wrote: The reference you listed:
WindowsApplication5.Properties.Resources... is not in vs2005
I'm using VS 2005 and C# as language."WindowsApplication5" is the project name.
button1.BackgroundImage = WindowsApplication5.Properties.Resources.logo ;
Okay. I will give you the VB.NET 2005 code. Please try the following steps.
- Create the new VB.NET window application in Visual Studio 2005
In Solution Explorer ~
1. Go to My Project under project root.
2. Double click to open the properties.
3. Go to "Resources"
4. Click "Add Resource" and "Add existing file"
5. ("File Open" dialog will be opened) Select the picture.
6. then, Save
7. Go to button Click event. (Make button a lit bit larger to see the image.)
8. Write the code below
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click<br />
Button1.BackgroundImage = My.Resources.Image1<br />
End Sub
9. Run the application
10. Click the button (Observe: the image will be shown on the button)
Hope it helps.
Thanks and Regards,
Michael Sync ( Blog: http://michaelsync.net)
If you want to thank me for my help, please vote my message by clicking one of numbers beside "Rate this message". Why vote? Plz Read it here. Thank you.
|
|
|
|
|
There is nothing wrong with your code. Try proving to yourself that "condition met" is actually True when it is tested, and that image2 is actually what you think that it is.
Tom Garth
Developer
R. L. Nelson and Associates, Inc., Virginia
|
|
|
|