|
Try this
dr.RecordsAffected
Regards
Pankaj Joshi
If you want to shape your dreams into reality, please wake-up...
|
|
|
|
|
hi i m begnner in vb 6 plz give me code to open a new form from the older form
thanx in advance
help as a alias.
Be happy and make others happy.Cheer up...........
|
|
|
|
|
HI...
Say u want to open form2 from form1
then what u cam do is
form2.show 'From the place in form1 where u want to show form2
you can close or hide form1 after u show form 2
form1.hide 'TO hide
unload.me 'To show
|
|
|
|
|
Why are you starting VB6 ? VB.NET is free, and VB6 is a dead, unsupported language.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
can anyone help me in getting the code for displaying the total no. of working days in a month using crystalreportviewer for generating a payslip?
I am creating a payroll system for a company using vb.net..
Another problem is that in loan repayment report,how do i display the names of all the months remaining till loan repayment is complete?..
pls help soon...........
god bless
|
|
|
|
|
Hi
I have Create windows Services. I have set Prorerty ServiceProcessInstaller Account is " LOCAL SYSTEM "
I want to get current loggin User ID..
If I set ServiceProcessInstaller Account is "USER" I can read User id But If i set " LOCAL SYSTEM " I cant read. But My Recruitment is Local System at the same time I want to read Current Login User Id.
How I can Read Help Me...
Thanks & Regards,
Sathiskumar.M
|
|
|
|
|
hi all,
anyone help me?
i have generated menus at run time.Now i want to disply reports on each menu.But i can't get index value of menu.I have created one click event for the menu but how i can identify the index of menu which is clicked.plz help me.
poonam
|
|
|
|
|
I am still confused on what you are trying to accomplish. Are you wanting an index value to determine what report to print? By the way, every control has a Tag variable. You could set integer values in the tag to differentiate betten the menu items.
Cheers!
Richard
may your code be error free.
(okay, maybe two lines.)
|
|
|
|
|
Hi Richard
Hw can i set tag value,Becoz my menus are generating at run time.Thats why i have created event handler.If i don't know which menu is clicked runtime then hw i can show the reports.I need a code which will store index value of a menu which is clicked.
by the way thanks for reply
poonam
|
|
|
|
|
Please post the code of how the menus are dynamically generated.
may your code be error free.
(okay, maybe two lines.)
|
|
|
|
|
[code]
Dim mShowMenuItem As System.Windows.Forms.MenuItem
mShowMenuItem = DirectCast(sender, System.Windows.Forms.MenuItem)
mShowMenuItem.MenuItems.Clear()
Dim n, i As Integer
Dim a, b As String
s = "Select srno from cash"
com = New OleDbCommand(s, con)
con.Open()
dr = com.ExecuteReader
While dr.Read
n = dr(0)
End While
con.Close()
For i = 1 To n
s = "Select account from cash"
com = New OleDbCommand(s, con)
con.Open()
dr = com.ExecuteReader
While dr.Read()
a = dr(0)
Dim mSubSubMenuItem As System.Windows.Forms.MenuItem
mSubSubMenuItem = New System.Windows.Forms.MenuItem
mSubSubMenuItem.Index = i
mSubSubMenuItem.Text = a
mSubSubMenuItem.Enabled = True
mSubSubMenuItem.Visible = True
AddHandler mSubSubMenuItem.Click, AddressOf MenuClickHandler
mShowMenuItem.MenuItems.Add(mSubSubMenuItem)
i = i + 1
End While
con.Close()
Next
this will generate menus
Public Sub MenuClickHandler(ByVal Sender As Object, ByVal e As System.EventArgs)
'Don't know wt to write here
End Sub
poonam
|
|
|
|
|
I'm playing around with the above method and I'm trying to calculate and display the difference between two dates. I'm getting the error "Value of type 'system.timespan' cannot be converted to 'string'". Can someone provide some guidance. Thanks. The following is my code.
Dim dateadd, datesubtract As System.DateTime
Dim datedifference As System.TimeSpan
Dim Date1 As System.DateTime = System.DateTime.ParseExact("20051127", "yyyyMMdd", System.Globalization.CultureInfo.CurrentCulture)
Dim Date2 As System.DateTime = System.DateTime.ParseExact("20061127", "yyyyMMdd", System.Globalization.CultureInfo.CurrentCulture)
datedifference = Date2.Subtract(Date1)
MessageBox.Show(datedifference)
George
|
|
|
|
|
The last line is the problem, that's where you assume a timespan is a string. Try the ToString method on the timespan object.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
|
Hi George,
compiler errors and run-time exceptions tend to show line numbers
(look at Exception.ToString(), not Exception.Message).
The Visual Studio editor can show them too, but for some mysterious reason does not do so
by default; see menu Tools/Options/Text Editor/All Languages/General/...
If you turn them on, you'll locate problem spots much more easily.
Luc Pattyn [Forum Guidelines] [My Articles]
this months tips:
- use PRE tags to preserve formatting when showing multi-line code snippets
- before you ask a question here, search CodeProject, then Google
|
|
|
|
|
HI
for the lie you wrote
MessageBox.Show(datedifference)
"datedifference" is not string....
TO resolve your issue you can convert datedifference's "value" to string using something like ctype
may be the this will work for you
MessageBox(Ctype(datedifference,String))
Good Luck
|
|
|
|
|
hi all
kidly help me to create menu with side by icon/image.
thanks in advance............
rmshah
Sr. Developer
|
|
|
|
|
Please Google before posting.
http://www.codeproject.com/vb/net/iconsmenu.asp
|
|
|
|
|
Hi,
If you want to add a icon to a menu item simply put the MenuStrip component on the form, and click where it says "Type here", type something, and then go to the properties window and click the part that says "Image", or you could use this code: FileToolStripMenuItem.Image(ImageName or path goes here) you will have to change the names accordingly.
Hope it was useful.
Lloyd A.
Lloyd J. Atkinson
"Logic will get you from A to B, but imagination will take you everywhere" -ALbert Einstein
|
|
|
|
|
Iam just begining of proggraming
I wan Study vb2005 proggraming
But I so Confiuse from where I must strart!
and If you have e-book pleace give me!
Thanks So much to you ALLS!
|
|
|
|
|
First step - buy a beginners book. A paper one. One you pay for, instead of stealing it ( most 'e-books' are not free ). Work through that, first.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Ok, this one is driving me nuts, can someone tell me what I am doing wrong?
I have a few MDI child forms open within a parent.
I need to run a sub on one of the child forms when an event occurs on another.
For example one of the child forms is created in the Load event of the MDIParent with the following:
Dim ChildForm2 As New GraphFrm<br />
ChildForm2.MdiPrent = Me<br />
ChildForm2.Show()
The GraphFrm contains a Sub UpdageGraphs() but when I attempt to call ChildForm2.UpdateGraphs() from the parent or any of the other MDI child forms I get an error that ChildForm2 is not declaired.
How do I make this instance of the child form accessible to the Parent and other child forms?
David Wilkes
|
|
|
|
|
Use delegates to call methods between forms.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Thanks for the suggestion.
I am still not completely clear on how to accomplish this.
I am guessing I would have to define the delegate in the parent but not entirely sure when to assign the address of the function to the delegate.
David Wilkes
|
|
|
|
|
Paul you helped me complete the mission using the excel spreadsheet as a linked server and a single sql query run on the sql server but I would like to know how to do this in VB now too. I feel I need to be able to do things like this in VB quickly and easily and I'm just not there yet. I'm hoping someone can help me understand how this can be done in VB.
I've loaded the excel spreadsheet via oledb into a datatable. Every record in this sheet needs name and address info added to it (the fields are there but are blank). I'm looping through the datatable and looking up required data in a sql server database. I need some help reading in the values returned by the query. I assume I have only 3 options ExecuteReader to return a DataReader object, ExecuteScalar to return a single value, and ExecuteNonQuery which returns nothing. I've never worked with ExecuteReader before. Is this the simpliest way to retrieve a couple pieces of data from a database query? See code below.
If MyOpenFileDialog.ShowDialog = Windows.Forms.DialogResult.OK Then
Dim filename As String = MyOpenFileDialog.FileName
Dim myExcelDt As New System.Data.DataTable
Dim myExcelConnection As New System.Data.OleDb.OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & filename & "; Extended Properties=""Excel 8.0""")
Dim myExcelSqlCommand As String = "SELECT * FROM [all ANIs$]"
Dim myExcelAdapter = New System.Data.OleDb.OleDbDataAdapter(myExcelSqlCommand, myExcelConnection)
myExcelAdapter.fill(myExcelDt)
Dim mySqlDt As New System.Data.DataTable
Dim Sql2000Connection As New System.Data.SqlClient.SqlConnection(Sql2000ConnectionString)
Dim Sql2000Command As New SqlClient.SqlCommand
Sql2000Command.Connection = Sql2000Connection
For Each excelrow As DataRow In myExcelDt.Rows
Sql2000Command.CommandText = "select fullname, address, city, state, zip from addresslist where phone = '" & excelrow("phone") & "'"
**** need help here ****
Next
End If
|
|
|
|