|
It is just 2 fields, date and time. I never used a command line. Do you have any example ?
By the way, they are in string format.
Heino
|
|
|
|
|
Remember that at the end of the day your VB.Net program is a exe file. So you can pass arguments to it like other exe file.
You can search on Google for handling command line arguments. About the data type of the arguments, it is a good idea to always consider them as strings and typecast them in the receiving code.
Shreekar
|
|
|
|
|
You can find information on getting your applications command line arguments here[^].
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
hi,
i m developing application in vb.net(winforms) & mysql
i have created connection object on form....but as connection is common to all forms so instead of taking it on every form i wnt to write connect function in my module.
will u pliz tell me how to write function for connection..
or wht more i can keep in module in any application of database connectivity.
---Priiya
priya
|
|
|
|
|
(Please try to write proper english. It's tiresome to have to read messages littered with SMS abbreviations and without anything that tells you where one sentence ends and the next begins.)
To create a connection in code, you just create an instance of the connection class for the specific database driver you are using. For an OleDb driver it will be:
Dim connection As OleDbConnection
connection = New OleDbConnection(connectionString)
Substitute connectionString with the actual connection string that you are using.
To make this code available from anywhere, put it in a static (shared in VB) method in some class:
Public Shared Function Connect() As OleDbConnection
Dim connection As OleDbConnection
connection = New OleDbConnection(connectionString)
Return connection
End Sub
---
Year happy = new Year(2007);
|
|
|
|
|
Some columns on the grid need to be centred. I have set the columns to centred and this works OK, except that on the column where the cell is repainted a different colour based on the cell value, the centering is lost.
I have set up some cell formats to change the cell alignment within the CellPainting event:-
formatCell.Alignment = StringAlignment.Center
formatCell.LineAlignment = StringAlignment.Center
formatCell.FormatFlags = StringFormatFlags.NoClip
Using the code below I get the value in the extreme top left of the cell instead of the centre.
If nsCellValue = 0 Then
'This is a full outage and is shown Red
' Erase the cell.
e.Graphics.FillRectangle(redBackBrush, e.CellBounds)
' Draw the grid lines (only the right and bottom lines;
' DataGridView takes care of the others).
e.Graphics.DrawLine(gridLinePen, e.CellBounds.Left, _
e.CellBounds.Bottom - 1, e.CellBounds.Right - 1, _
e.CellBounds.Bottom - 1)
e.Graphics.DrawLine(gridLinePen, e.CellBounds.Right - 1, _
e.CellBounds.Top, e.CellBounds.Right - 1, _
e.CellBounds.Bottom)
' Draw the text content of the cell
If Not (e.Value Is Nothing) Then
e.Graphics.DrawString(CStr(nsCellValue), e.CellStyle.Font, _
Brushes.Black, e.CellBounds.X + 2, e.CellBounds.Y + 2, _
formatCell)
End If
e.Handled = True
etc...
The formatCell in the Drawstring property just does not seem to work. Any ideas on what I am doing wrong would be appreciated.
-- modified at 7:40 Tuesday 16th January, 2007
David Loring
!! Keep Music Live !!
-- modified at 7:40 Tuesday 16th January, 2007
|
|
|
|
|
Yeah, I've gotten some goofy results out of DrawString too. This is what I eventually found that worked for me.
Dim sf As New StringFormat()
sf.FormatFlags = StringFormatFlags.NoWrap Or StringFormatFlags.FitBlackBox
sf.LineAlignment = StringAlignment.Center
sf.Alignment = StringAlignment.Center
sf.Trimming = StringTrimming.None
Dim g As Graphics = e.Graphics
g.TextRenderingHint = Drawing.Text.TextRenderingHint.AntiAliasGridFit
g.DrawString( text, font, brush, cellwidth / 2, cellHeight / 2, sf)
g.Dispose()
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Thanks very much Dave. I'll give that a whirl!
David Loring
!! Keep Music Live !!
|
|
|
|
|
how do i use combobox in a grid it may be msflex grid of vsflexgrid
akshat
|
|
|
|
|
hi all .net programmers. I need logic.
I can download one file at a time
sending command PASV and RETR
but it downloads only one file at a time
if file is retriving.. I can send more command except ABOR (server don't response)
is there any way to download multiplefile in same time.. (JUST like in Cute FTP Professional 6.0)
|
|
|
|
|
You can do multithreading. You can retrieve different files on different threads. However, you need to design your application to support multithreading - think of thread locking issues, UI update issues, how to share data between threads etc. - MSDN would be a good place to start.
In short, multi threading is the answer to your question.
Shreekar
|
|
|
|
|
Can anyone give me an example that i can priview datagrid?
Socheat
................
|
|
|
|
|
|
seekdharani wrote: Put that datagrid inside the Div tag
I think the question might be related more to desktop applications and hence div tag may not be applicable.
[edit]Seems like the post I replied to was deleted.[/edit]
For the OP - You can generate a class object from the data in the gridview and generate a report based on that class object.
-- modified at 23:43 Tuesday 16th January, 2007
Shreekar
|
|
|
|
|
Okay i was wondering how i could change the name in the list box on an amend feature.
so far i got
<br />
<br />
Dim Rum As Integer<br />
<br />
If listbox1.SelectedIndex = -1 Then<br />
Exit Sub<br />
End If<br />
<br />
Num = listbox1.SelectedIndex<br />
<br />
frm1.R.Rt = txtRtText<br />
frm1.R.Rp = CSng(txtrp.Text)<br />
<br />
<br />
frm1.Rooms(Rum) = frm1.Room<br />
<br />
txtRt.Clear()<br />
txtRp.Clear()<br />
It changes it in "rt" and "rp" but wont change the name in the list box
|
|
|
|
|
What form is this ListBox on and what form is this code you posted on? Are you trying to update a listbox on one form from another? What is frm1 and how did it get defined?
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Basically it is all on the same form but i a "Class" with
"RT" = String for a name
"RP" = Integer for a number
So basically i want to be able to recall data into textbox ( i know how to do this) then amend the current data.
If i select "Coffee" from the listbox it will display " coffee " and the "number" in two different text boxes. The amend on the Number works fine but when i change "Coffee" to "Coffee with sugar", it will still display "Coffee" in the list box. So now if i click "coffee" again it will show " coffee with sugar" but still coffee as the list box item and i want it to be "coffee with sugar"
Only way i found around it is by making it delete it from there and readding it but surly there is a way around that ,.
<br />
<br />
Dim Rum As Integer <br />
<br />
If listbox1.SelectedIndex = -1 Then 'if list box = not selected then ..<br />
Exit Sub<br />
End If<br />
<br />
Num = listbox1.SelectedIndex ' making variable = list boxes selected index<br />
<br />
frm1.R.Rt = txtRtText ' makes the class R.Rt = textbox<br />
frm1.R.Rp = CSng(txtrp.Text) ' makes class r.rp = textbox<br />
<br />
<br />
frm1.Rooms(Rum) = frm1.Room <br />
<br />
txtRt.Clear()<br />
txtRp.Clear()<br />
|
|
|
|
|
The code you're showing doesn't update the ListBox, so it's impossible to say what you're doing wrong. But, have you tried calling Refresh on the ListBox when you're done updating it?
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
How do you refresh the list box, the code i provided only updates the where the data is being store i thought it would refresh/update the name once u change it
|
|
|
|
|
Uhhh, no. You'll have to remove the item from the ListBox and re-add it.
Your other alternative is to create a typed dataset, load your data into that, then bind the ListBox to the dataset. If you do that, then any changes to you make should be updated in the ListBox when they're made.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
hi,
i wrote following code to validate my all controls on form.
it is working well but when i run my project & for testing purpose i leave the textbox as it is
following code executed & showing appropriate message but it is validating controls randomly....& i wnt that it should validate control in a sequence
( e.g. employeeid ,empname,designation......etc).
i have given tabindex to all controls in sequence though it is validating controls in random manner Wht shuld i do??
Is there anyone who will solve my problem????
Public Function Validate_Ctrl(ByVal sender As Form) As Boolean
For Each obj In sender.Controls
If TypeOf obj Is TextBox Then
If obj.Name = "txtSearch1" Or obj.Name = "txtSearch2" Or (TypeOf obj Is CheckBox) Then Continue For
If obj.Text = "" Then
MsgBox("Please Enter Values In " + obj.Name, MsgBoxStyle.Exclamation + MsgBoxStyle.OkOnly, obj.Name + " Validation")
obj.Focus()
Validate_Ctrl = False
Exit Function
End If
End If
Next
Validate_Ctrl = True
End Function
priya
|
|
|
|
|
As far as I know, the for each loop will visit the controls not according to tab index, but something else.
A cumbersome method can be to load all the controls in an array and then sort them based on their tab index and then apply the validations on them.
A simpler method might be to use ErrorProvider and the validate events for a better control over validation (This applies only in .Net 2.0) - so if you are using VB 6, ignore this part.
Shreekar
|
|
|
|
|
any code for doing a booking system in vb.net and just using the database to store the details. require code for the seats which are going to be text boxes 200 minimum 600 maximum and going to be using the tab index to return that specific seat number, which when searching a specific date tells me that whether the seats are free or booked and if free will let me book the seat for the customer, and if booked display the customers name seat no, and row, seat 30 x 20= 600 from rows A to T. jsu tell me where to look if possible please for the appropriate code thank you
-- modified at 9:24 Tuesday 16th January, 2007
|
|
|
|
|
Is this homework, or are you being paid to write this ? Sounds more like the former, but either way, the way to do this is well documented online, if you're not willing to do some research and start your project, you're on your own. If you're willing to give it a go, and ask specific questions when you get stuck, we're here to help.
Christian Graus - C++ MVP
'Why don't we jump on a fad that hasn't already been widely discredited ?' - Dilbert
|
|
|
|
|
Here[^] we go. Trainwreck in progess...
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|