|
You can't create a single connection string for three different databases. You probably shouldn't use the same data layer class, either, there are specialised Oracle and SQL Server classes in the framework.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"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 )
|
|
|
|
|
Yes I have multi connection but my problem.
My application can't connect to oracle database server
because in connection string of Oledb class for oracle didn't have
initial catalog same Microsoft Sql server for point to oracle server database.
How I do next for my client application
|
|
|
|
|
Like I said, create a data access layer class for each database, which uses the classes designed for that database.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"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 )
|
|
|
|
|
Hi all i created 3 tabs so i be able to switch between webbrowser and listview. I want the first tab to be select by default onload of the form. could any one show me how this can be done?Thanks
Private Sub SSTab1_Click(PreviousTab As Integer)<br />
If SSTab1.Tab = 0 Then<br />
WebBrowser2.Visible = True<br />
Else<br />
WebBrowser2.Visible = False<br />
End If<br />
<br />
If SSTab1.Tab = 1 Then<br />
<br />
ListView4.Visible = True<br />
Else<br />
<br />
ListView4.Visible = False<br />
End If<br />
<br />
'If SSTab1.Tab = 2 Then<br />
' WebBrowser4.Visible = True<br />
'Else<br />
' WebBrowser4.Visible = False<br />
'End If<br />
End Sub
-- modified at 19:55 Thursday 10th May, 2007
|
|
|
|
|
Can anyone tell me how to drag and drop a file onto my form so I may read its contents into a rich text box I create at runtime? thanx in advance!
Dª×
|
|
|
|
|
could any one show me how i can add clock timer that shows hour:min:seconds to a perticuler listview column ?
I want to add running time as a listview -item.
I have seen applications that they added timer to listview item and ability to freez it or reset it when diffrent events happens. There are a few other columns in my listview too. So i want add running timer to 3th column.I hope there be a solution that doesn't disturb the focous .
I want to add this running timer in the 3th column of a row that i specify. Not all rows at once.So by default other rows i want it to have - and when i decide for example add running time to row 3 then it be added.I want to have the abiliy to freez the time when i want or remote it.
|
|
|
|
|
add the timer control your form
set the interval to 1000
in the event routine, use the keyword 'now' and format it to be hh:nn:ss and keep replacing the value of the cell with the result
|
|
|
|
|
Thanks for you reply. could show me how to add 'now' and format it to be hh:nn:ss ...
I am adding item to listview like this :
ListView1.ListItems(1).ListSubItems(3).Text = "changed2"
so how to add running time instead of change2? Do you think using this method will make the listview reload every seconds? i hope that is not the case since it will disturb form focus. I have seen applications that they add running time to listview column without any listview reload every seconds .
|
|
|
|
|
vb6 - format(now,"hh:nn:ss")
vb.net - now.tostring("hh:mm:ss")
|
|
|
|
|
Thanks for you reply. I tried the following and it only display the current time!! I wanted to start from 00:00:00 and start running
ListView1.ListItems(1).ListSubItems(4).Text = Format(Now, "hh:nn:ss")
|
|
|
|
|
make a module level variable that will hold to the current ticks
private mStartDate As Double = Now.Ticks
in the timer event routine
Dim s As String = TimeSpan.FromTicks(Now.Ticks - mStartDate).ToString
ListView1.ListItems(1).ListSubItems(4).Text = s.Substring(0, s.IndexOf("."))
|
|
|
|
|
I placed "private mStartDate As Double = Now.Ticks: inside a module.
Then i added timer to the form an set its interval to 1000.Then i added following code:
<br />
Private Sub Form_Load()<br />
<br />
<br />
Timer2.Interval = 1000 ' <-- 10 seconds<br />
Timer2.Enabled = True<br />
End Sub<br />
<br />
Private Sub Timer2_Timer()<br />
Static lngMin As Long<br />
<br />
lngMin = lngMin + 1<br />
<br />
'every 2nd timer tick reload the listview<br />
If lngMin Mod 2 Then<br />
<br />
Dim s As String = TimeSpan.FromTicks(Now.Ticks - mStartDate).ToString<br />
ListView1.ListItems(1).ListSubItems(4).Text = s.Substring(0, s.IndexOf("."))<br />
<br />
End If<br />
<br />
End Sub<br />
<br />
then i get compile error :
Expected: end of statement
pointing at:
private mStartDate As Double = Now.Ticks
|
|
|
|
|
this is vb6? i didn't think vb6 had listviews
you can always create the time manually but I'll try to come up with vb6 equvilent...
|
|
|
|
|
Many thanks for trying to help me . I am working on vb6 for this project. VB6 has listviews by selecting Microsoft windows common controls 6.0(sp6) component. I have seen a few applications not sure what programing language they are written it .They add timer to listview without noticing any flicker or reload!!
|
|
|
|
|
***make a module level variable***
private mStart as single
***in the load event of the form***
mStart = Timer
***in the timer event routine***
ListView1.ListItems(1).ListSubItems(4).Text = Format(TimeSerial(0, 0, cint(Timer - mStart), "hh:nn:ss")
-- modified at 17:26 Friday 11th May, 2007
|
|
|
|
|
I tried it i get the following error:
compile error:
syntax error
pointing at :
ListView1.ListItems(1).ListSubItems(4).Text = Format(TimeSerial(0, 0, cint(Timer - mStart), "hh:nn:ss")
|
|
|
|
|
sorry...add a paren after the cint
Format(TimeSerial(0, 0, cint(Timer - mStart)), "hh:nn:ss")
|
|
|
|
|
Now i get this error in the same line:
Run-time error 6:<br />
<br />
overflow
|
|
|
|
|
ok, use clng instead of cint
|
|
|
|
|
same overflow error (
Private Sub Form_Load()<br />
mStart = Timer<br />
<br />
'Set up the listview<br />
ListView1.View = lvwReport<br />
ListView1.ColumnHeaders.Add , , "Artist"<br />
ListView1.ColumnHeaders.Add , , "Name"<br />
ListView1.ColumnHeaders.Add , , "Image"<br />
ListView1.ColumnHeaders.Add , , "Rating"<br />
'ListView1.ColumnHeaders.Add , , "Song ID"<br />
ListView1.ColumnHeaders.Add , , "Total Votes"<br />
ListView1.ColumnHeaders.Add , , "Page"<br />
ListView1.ColumnHeaders.Add , , "Referrer"<br />
ListView1.ColumnHeaders.Add , , "pageWindowName"<br />
<br />
<br />
Timer1.Interval = 1000 ' <-- 10 seconds<br />
Timer1.Enabled = True<br />
<br />
<br />
End Sub<br />
<br />
Private Sub Timer1_Timer()<br />
<br />
ListView1.ListItems(1).ListSubItems(4).Text = Format(TimeSerial(0, 0, CLng(Timer - mStart)), "hh:nn:ss")<br />
<br />
End Sub
|
|
|
|
|
anyone have a function that converts milliseonds to minutes and seconds?
im working in vb.net. thanks a bunch.
|
|
|
|
|
You can either write this function yourself, the math is very easy, or you can use the TimeSpan class to do it for you.
Dim x As New TimeSpan(0, 0, 0, 0, milliseconds)
Console.WriteLine("Minutes: " & x.Minutes)
Console.WriteLine("Seconds: " & x.Seconds)
|
|
|
|
|
|
Of course we don't care about rounding...
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
CPallini wrote: Of course we don't care about rounding...
The exact specifics of which are left up to the reader, depending on specifications of course!
|
|
|
|