|
The setup wizard is a go place to start. Click File, Add, New project. Once created right click the project name in the explorer to make the .net framework a prerequisit.
|
|
|
|
|
This is my code to get the LAN connection status.
LBox.Items.Clear()
Dim childEntry As DirectoryEntry
Dim ParentEntry As New DirectoryEntry
Try
ParentEntry.Path = "WinNT:"
For Each childEntry In ParentEntry.Children
Select Case childEntry.SchemaClassName
Case "Domain"
Dim SubChildEntry As DirectoryEntry
Dim SubParentEntry As New DirectoryEntry
SubParentEntry.Path = "WinNT://" & childEntry.Name
For Each SubChildEntry In SubParentEntry.Children
Select Case SubChildEntry.SchemaClassName
Case "Computer"
LBox.Items.Add(SubChildEntry.Name)
End Select
Next
End Select
Next
Catch Excep As Exception
MsgBox("Error While Reading Directories")
Finally
ParentEntry = Nothing
End Try
End Sub
i use this code to get all Machines on the Local Area network .
here one problem occured
when i SWITCH ON my server,i get the list of machines name whatever, connected in Local Area network.after 5 min again i run the application
i didn't get antything
plz give the solution
|
|
|
|
|
can anybody tell me what are the equivalent of VB code in C#
"vorep As CRAXDRT.REPORT"--- what to do for this one means what assembly i need to add.
Set m_voApp = CreateObject("CrystalRuntime.Application")--- how to create the object for this...
and what is the use of this...
please help me...
vikas da
|
|
|
|
|
use the following link
http://labs.developerfusion.co.uk/convert/vb-to-csharp.aspx
|
|
|
|
|
But this is not working .. means converted code...
can u please tell me what is the use of above codes present in my first post...
vikas da
|
|
|
|
|
Hi all,
i am developing a windows application in which i want to give authentication for the user to login.
Please help me how to give authentication in windows application.
Regatds,
Mohan
|
|
|
|
|
i have three text box and a command button.initially button enable is false.i want if user input the values in textbox.and no textbox is blank then button enable is automatically true. and if any textbox is blank then button enable gets automatically false.
please help
sumit
|
|
|
|
|
Hi Sumit,
I would suggest you to write the following code on the change event of each textbox.
BEGIN CODE
Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox1.TextChanged
If Len(Me.TextBox1.Text) = 0 Then
Me.Button1.Enabled = False
Else
Me.Button1.Enabled = True
End If
End Sub
END CODE
I hope this helps .
Regards,
John Adams
ComponentOne LLC
|
|
|
|
|
hiiii
thank you for the suggestion but your code work for only one textbox.i have three textboxes and have to do the same for three textbox and a command button.when a user enter text on any textbox it should check for other textbox also
|
|
|
|
|
Presumably the button is to save the data?
A couple of issues with your design.
is enabled bsed on the values in ALL the text boxes - you are testing only 1 at a time.
Try this.
btnSave stats disabled.
you have 1 event called SaveOn which is used for each textbox ontextchange event. Here is one I used
Private Sub SaveON(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles txtUserID.TextChanged, txtEmail.TextChanged, txtPWD.TextChanged, txtUserID.TextChanged, txtUserName.TextChanged, txtUserNo.TextChanged, chkDisabled.CheckedChanged, chkPWDExpireFlag.CheckedChanged, dtePWDExpire.ValueChanged<br />
btnSave.Enabled = True<br />
End Sub
Note the Handles for the different objects and events
In the save event you disable the save button
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
I have a loop for adding rows of value to DataGridView Control with fixed size. The scroll bar appeared after row number is more than what DataGridView can display. The question is:
How can I implement auto-scroll so that the bottom row always visible after adding new row?
|
|
|
|
|
Count your rows using:
<br />
dim rows as integer<br />
rows = DataGridView1.Rows.Count<br />
Then see how many rows are visible,
let say 10.
Then use:
<br />
DataGridView1.FirstDisplayedScrollingRowIndex = rows - 10<br />
Good Luck.
|
|
|
|
|
Hi, Scubapro:
Thank you very much!
|
|
|
|
|
Dim sqlConnection1 As New System.Data.SqlClient.SqlConnection("Data Source=MUSCRIBMPC\SQLEXPRESS;Initial Catalog=adp3SQL;Integrated Security=True")
Dim fname, lname As String
fname = TextBox2.Text
lname = textbox2.text
Dim cmd As New System.Data.SqlClient.SqlCommand
cmd.CommandType = System.Data.CommandType.Text
cmd.CommandText = "update compiledpts set firstname=fname, lastname=lname where contactid = 2"
cmd.Connection = sqlConnection1
sqlConnection1.Open()
cmd.ExecuteNonQuery()
sqlConnection1.Close()
contactid is the table ID, compiledpts is the name of the table. everything else works except the syntax in the commandtext. if firstname is = " anytext " it updates with that text but I cannot use fname and I cannot use more than one viriable. WHAT IS WRONG PLEASE?
|
|
|
|
|
The syntax would be....
"update compiledpts set firstname='" & fname & "', lastname='" & lname & "' where contactid = 2"
Tirtha
Do not go where the path may lead, go instead where there is no path and leave a trail.
Author: Ralph Waldo Emerson (1803-82), American writer, philosopher, poet, essayist
|
|
|
|
|
Thankyou so very much I can not thankyou enough. It worked perfectely. Infact I am now trying to expand the same to allow insert and delete. You have helped me immensely. Thankyou you are a very good person
|
|
|
|
|
|
how can a command button trigger a scanner???
thanks in advance
|
|
|
|
|
How I can using araay of buttons in vb.net?
|
|
|
|
|
try this
clickety[^]
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
you cant make array of control in vb.net
|
|
|
|
|
I am using VB to update a detailsview I have a dropbox and a textbox
I do detailsview.rows.cells = dropbox.selectedvalue and
detailsview.rows(x).cells(1) = textbox.text. both these lines appear in my ok button. This works and the detailsview is changed. The problem is the database is not changed. How do I update the database with my new values? Thanks in advance
|
|
|
|
|
MUSIWA wrote: The problem is the database is not changed
Why would it have changed? You haven't posted any code which updates the database.
It won't happen by magic. You actually have to write code to do it. If you don't know how to update a database using VB.NET, I suggest you buy a book on ADO.NET and read up on the subject.
Paul Marfleet
"No, his mind is not for rent
To any God or government"
Tom Sawyer - Rush
|
|
|
|
|
I thought I did I thought there was an update command that I can add to my button to move the data to the database. I guess I was wrong. I am sorry if I insulted your intelligence but I am trying to learn this. Nevertheless I still need some direction. I abadon that though and now I am using an execute command see below
Dim sqlConnection1 As New System.Data.SqlClient.SqlConnection("Data Source=MUSCRIBMPC\SQLEXPRESS;Initial Catalog=adp3SQL;Integrated Security=True")
Dim fname, lname As String
fname = TextBox2.Text
lname = textbox3.text
Dim cmd As New System.Data.SqlClient.SqlCommand
cmd.CommandType = System.Data.CommandType.Text
cmd.CommandText = "update compiledpts set firstname = fname, Lastname= lname where contactid = 2"
cmd.Connection = sqlConnection1
sqlConnection1.Open()
cmd.ExecuteNonQuery()
sqlConnection1.Close()
now this stament does not work even though when I debugg the value of the textboxes have the correct values. The connection string works too. My problem is the command text is not working. Can you help me know what is wrong with it. Thanks!
|
|
|
|
|
MUSIWA wrote: cmd.CommandText = "update compiledpts set firstname = fname, Lastname= lname where contactid = 2"
This won't work. You have to build up the command text string, concatenating the variable values with the literal text. This isn't considered a good approach though, as it leaves your code vulnerable to SQL injection attacks. Consider using a stored procedure and parameters instead.
Paul Marfleet
"No, his mind is not for rent
To any God or government"
Tom Sawyer - Rush
|
|
|
|