|
Generate a random integer within the range of your enum then Enum.Parse the integer to the enum.
|
|
|
|
|
hi all,
please tell me how i manage my multipages in a single crystal report using vb.net
thanks in adv.
rmshah
Developer
|
|
|
|
|
Your question is so vague, it's unanswerable. What do you mean by "manage"??
|
|
|
|
|
thanks for reply,
i have a folded form (VAT-20) which has four part
(front side, back side and two opp. side in middle)
i want to designe it in crstal reports. my problem is to show all thease in a report at run time.
pl help me.
rmshah
Developer
|
|
|
|
|
Insert a page break into the report at the required position(s) when you design it!
|
|
|
|
|
Hi,
my code
command.CommandText = "SELECT COLUMN_NAME, SEARCH_CONDITION " & _
"FROM(USER_TAB_COLUMNS) " & _
"WHERE TABLE_NAME ='" & tableName & "'" & _
"AND DATA_DEFAULT IS NOT NULL"
reader = command.ExecuteReader()
constraintsList.Load(reader)
constraintsList is datatable
it is not showing the SEARCH_CONDITION column when it is binded with
a datagrid
desc USER_TAB_COLUMNS shows that SEARCH_CONDITION is LONG column(Oracle db)
i searched google also
can i see long column in a datagrid using datatable
please help.
thanks
jomet 
|
|
|
|
|
I am using Oracle ODP.Net drivers
and
command.InitialLONGFetchSize = 1000 solved my problem

|
|
|
|
|
Hello,
I'm doing some experiments which return large arrays of data. I was wondering if there was some way to make a 2 dimensional plot of this data within the Visual Basics form. I am running the visual basics editor from excel.
I appreciate you help,
Orlando
|
|
|
|
|
In a seperate worksheet, this is easily done. If on your form, you'd have to use an external library to do this, such as the MSChart control. I've never done this in Excel, so my experience is going to be quite limited.
|
|
|
|
|
Hello Dave,
Thank for your reply.
I am looking to do it within the form. Do you know of any libraries that would enable plotting.
If not, how do I go about plotting in a separate worksheet.
Thanks so much,
Orlando
|
|
|
|
|
I just gave you one... MSChart, IF it's. Go to Tools, References, and scroll through the list. You mightbr mode="hold" />If not, you'll have to find a 3rd party COM library (ActiveX control) that does this. I don't know of any myself. Try Googling for "VB6 chart control".
|
|
|
|
|
|
|
Test this code
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
' supposing we have a label and it has the text 00:00:00 when the form loads
' Timer interval we can set as per requirement
' I have set it for 0-9. If you want to test upto 1 minute then change 9 by 99 and 10 by 100
s = Label1.Text.Split(":")
If CInt(s(2)) >= 0 AndAlso CInt(s(2)) < 9 Then
s(2) = Format(CInt(s(2)) + 1, "00")
ElseIf CInt(s(2)) = 9 Then
s(2) = Format(0, "00")
s(1) = CInt(s(1)) + 1
s(1) = Format(CInt(s(1)), "00")
End If
If CInt(s(1)) = 10 Then
s(0) = Format(CInt(s(0)) + 1, "00")
s(1) = Format(0, "00")
End If
Label1.Text = s(0) & ":" & s(1) & ":" & s(2)
End Sub
Hope this solves the purpose.
|
|
|
|
|
LOL!
This is awesome advice!!!
|
|
|
|
|
I just forgot to mention one thing.
Declare an string array globally like:
Dim s() as String
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
' supposing we have a label and it has the text 00:00:00 when the form loads
' Timer interval we can set as per requirement
' I have set it for 0-9. If you want to test upto 1 minute then change 9 by 99 and 10 by 100
s = Label1.Text.Split(":")
If CInt(s(2)) >= 0 AndAlso CInt(s(2)) < 9 Then
s(2) = Format(CInt(s(2)) + 1, "00")
ElseIf CInt(s(2)) = 9 Then
s(2) = Format(0, "00")
s(1) = CInt(s(1)) + 1
s(1) = Format(CInt(s(1)), "00")
End If
If CInt(s(1)) = 10 Then
s(0) = Format(CInt(s(0)) + 1, "00")
s(1) = Format(0, "00")
End If
Label1.Text = s(0) & ":" & s(1) & ":" & s(2)
End Sub
Hope this solves the purpose.
|
|
|
|
|
Wow, this is pretty bad. A value of time like this would normally be represented in your code by a TimeSpan object. You can then increment this time by adding 1 second to it on each tick of a 1000 millisecond timer.
Your code can then be replaced by a very simple, single line of code:
Label1.Text = myTimeSpan.ToString()
|
|
|
|
|
Dave Kreskowiak wrote: Wow, this is pretty bad
Masterful understatement, such restraint.
|
|
|
|
|
Hi, i'm from mexico, sorry for my english...
i need help....
Somebody tell me how rotate my WinForm 360º or
rotate 3D my WinForm....
I Know that is very difficult.....
any link, document is good !!!
Thanks!!!!!!!
|
|
|
|
|
You can't. Instead, write your app using WPF.
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 i am new in vb.net and i am working on my assigment, I have crated ms access database, i can add new questions and i can also get all questions from database with 4 options it's working fine but now i want to randomize it
and code is some thing like this to open con. and display it and i also try to create array because we dont know how many questions are there in database so when con. opens first it counts how many questions are there and if array is smaller then it increse array size i am not sure that this right or wrong but i am just trying it and when i debug it it increses the array size if it small but i dont know how to randomize it
Try<br />
<br />
Me.conTest.ConnectionString = _<br />
"Provider=Microsoft.Jet.OLEDB.4.0;" & "Data Source= MyTest.mdb"<br />
Catch eConnection As System.Exception<br />
MessageBox.Show(eConnection.Message)<br />
End Try<br />
<br />
'if array size is smaller then increase as per entry<br />
ArraySize = Count<br />
Dim IntegerArray(ArraySize) As Integer<br />
'sort integers<br />
Call SortArray(ArraySize, IntegerArray)<br />
Try<br />
odaTest.Fill(dsTest)<br />
'lblNo.Text = Me.BindingContext(dsTest.MyTest).Position<br />
Catch eLoad As System.Exception<br />
MessageBox.Show(eLoad.Message)<br />
End Try<br />
Call dsContacts_PositionChanged()<br />
End If
this is for array
Private Sub SortArray(ByVal N As Integer, ByVal SortedArray() As Integer)<br />
'increase the array size according to number of entry <br />
For I As Integer = 0 To N<br />
SortedArray(I) = I<br />
Next I<br />
End Sub
so can you please help me with this
waiting for your kind rep.
thanks
|
|
|
|
|
your questions should have an id in the database, use the Random.Next method to generate a random Id. If you need to make a series of questions with no repeats, build a list of array indexes and use the Random class to generate a random index into that array. Pull out the number at that index and remove it so it doesn't get used again
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 )
|
|
|
|
|
hello sir
thanks for your rep.
this is what i have done, it's randomize the questions but i dont know how to stop displaying same question again
any help sir
Private Sub NavNext()<br />
Try<br />
odaTest.Fill(dsTest)<br />
R = Rnd() * ArraySize<br />
'[Go to the next entry]<br />
<br />
Me.BindingContext(dsTest, "MyTest").Position = R<br />
Catch eLoad As System.Exception<br />
MessageBox.Show(eLoad.Message)<br />
End Try<br />
'[See custom procedures]<br />
Me.dsContacts_PositionChanged()<br />
End Sub
I dont know that this is the right way to do it but i am trying
waiting for your kind rep.
|
|
|
|
|
Here is a basic code snipet of how to use an ArrayList to keep track of your random numbers.
My application is just one form with 2 buttons and a rich text box.
Click on button1 to generate a random number, it checks if it has not been generated before, adds it to the list and displays it in the textbox. If the number already exists, a msgbox is displayed.
Button2 is used to display the current contents of the ArrayList in the debug immediate window.
<br />
Public Class Form1<br />
Dim myNumbers As New ArrayList<br />
<br />
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click<br />
Dim iMyRnd As Integer<br />
<br />
' Initialize the random-number generator.<br />
Randomize()<br />
' Generate random value between 1 and 10.<br />
iMyRnd = CInt(Int((10 * Rnd()) + 1))<br />
<br />
If (myNumbers.IndexOf(iMyRnd) < 0) Then<br />
myNumbers.Add(iMyRnd)<br />
Me.RichTextBox1.Text = Me.RichTextBox1.Text + vbCrLf + CStr(iMyRnd)<br />
Else<br />
MsgBox("Already generated number: " + CStr(iMyRnd))<br />
End If<br />
End Sub<br />
<br />
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click<br />
Dim i As Integer<br />
<br />
For i = 0 To myNumbers.Count - 1<br />
Debug.Print(myNumbers(i).ToString)<br />
Next<br />
End Sub<br />
End Class<br />
|
|
|
|
|
hello sir
first of all thank you very much for your rep.
it works fine but i have done some thing like this , and it's not showing same question again
is this right way to do it ?
If AskedQ >= ArraySize Then<br />
MessageBox.Show("Finish want to play again..?", "Finish", MessageBoxButtons.OK)<br />
For I As Integer = 0 To ArraySize<br />
Asked(I) = False<br />
AskedQ = 0<br />
Next<br />
txtQ.Text = "" : txtA.Text = "" : txtB.Text = "" : txtC.Text = "" : txtD.Text = ""<br />
Button1.Enabled = True : Button2.Enabled = True<br />
Exit Sub<br />
Else<br />
Try<br />
Do<br />
odaTest.Fill(dsTest)<br />
R = CInt(Int(ArraySize * Rnd()))<br />
<br />
'[Go to the next entry]<br />
Me.BindingContext(dsTest, "MyTest").Position = R<br />
Loop Until Asked(R) = False<br />
<br />
AskedQ += 1<br />
Asked(R) = True<br />
Catch eLoad As System.Exception<br />
MessageBox.Show(eLoad.Message)<br />
End Try<br />
'[See custom procedures]<br />
Me.dsContacts_PositionChanged()<br />
End If
thanks again
|
|
|
|