|
deepakkp wrote: Please send me vb.net code to check and uncheck nodes in treeview with multiple root nodes, subnodes
Sure thing. Please tell me how much you can pay into my Paypal account.
|
|
|
|
|
I want to put a Label or a Picture Box on a MDI Form, which can display some information or display a picture on the MDI form. If I put a label or picture box on the MDI form then, it gets displayed on the top of all child forms. How to display it on the background like the BackgroundImage property of the MDI form. Please Help...
Thanks in Advance.
Sekhar
|
|
|
|
|
You can't - that's what a MDI-form is for. In this case you can get around the issue by painting your own background image (with the image from the PictureBox / text from the Label) and displaying this.
Normaly if you want some information shown on the MDI - form you add a StatusBar or ToolBar
|
|
|
|
|
Thanks CKing, How can I put some information that frequently changes ?
Sekhar
|
|
|
|
|
Just use a StatusBar - most users are used to this kind of visual information.
|
|
|
|
|
Hi everyone ,
I'm using vb.net 2003 (window application).
I have 2 textbox and want to add these 2 text into datagrid. But when i click "Add" Button for the 1st time, no problem. But after i click the 2 times, it replaced with the 1st row. But what i want is to add them into 2nd or subsequent rows depending on how many times i click 'Add' button.The 1st row remain.
Here i attach with my codes. I hope someone can hint me where is my mistake.
Thanks in advanced.
Private Sub btnAdd_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnAdd3.Click
Dim Table1 As DataTable
Table1 = New DataTable("LotNumber")
Dim Row As DataRow
Try
Dim HBarCode As DataColumn = New DataColumn("HBarCode")
HBarCode.DataType = System.Type.GetType("System.String")
Table1.Columns.Add(HBarCode)
Dim EMIBarCode As DataColumn = New DataColumn("EMIBarCode")
EMIBarCode.DataType = System.Type.GetType("System.String")
Table1.Columns.Add(EMIBarCode)
Row = Table1.NewRow()
Row.Item("HBarCode") = Me.txtHBarCode.Text
Row.Item("EMIBarCode") = Me.txtEMIBarCode.Text
Table1.Rows.Add(Row)
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try
Dim ds As New DataSet
ds = New DataSet
ds.Tables.Add(Table1)
dgResult.SetDataBinding(ds, "LotNumber")
End Sub
thanks, eunice
|
|
|
|
|
Ok - the problem is that you allways create a new DataTable whenever you click add.
Put the section with the creation of the datatable / dataset to Form_Load or some other initialiser (you only want to call this once or when you need a clean DataTable) (Set the DataTable to be a private member of your class for access)
So you should get:
<br />
<br />
private myTable as DataTable = nothing<br />
<br />
public Sub InitGrid()<br />
<br />
myTable = New DataTable("LotNumber")<br />
Dim HBarCode As DataColumn = New DataColumn("HBarCode")<br />
HBarCode.DataType = System.Type.GetType("System.String")<br />
myTable .Columns.Add(HBarCode)<br />
<br />
Dim EMIBarCode As DataColumn = New DataColumn("EMIBarCode")<br />
EMIBarCode.DataType = System.Type.GetType("System.String")<br />
myTable .Columns.Add(EMIBarCode)<br />
<br />
Dim ds As New DataSet<br />
ds = New DataSet<br />
ds.Tables.Add(myTable)<br />
dgResult.SetDataBinding(ds, "LotNumber")<br />
<br />
end sub<br />
<br />
and
<br />
Private Sub btnAdd_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnAdd3.Click<br />
<br />
if myTable is nothing then InitGrid()<br />
<br />
Dim Row As DataRow<br />
<br />
Try<br />
<br />
Row = myTable.NewRow()<br />
Row.Item("HBarCode") = Me.txtHBarCode.Text<br />
Row.Item("EMIBarCode") = Me.txtEMIBarCode.Text<br />
myTable.Rows.Add(Row)<br />
<br />
Catch ex As Exception<br />
MessageBox.Show(ex.Message)<br />
End Try<br />
<br />
dgResult.Update()<br />
End Sub <br />
<br />
|
|
|
|
|
Hi CKnig,
Thanks a lot. It works now.
Appreciate that.
cheers,
eunice
|
|
|
|
|
Hi CKnig,
Can you advice me how should i write the code if i want to save the data from datagrid to database?
eg: Let's say i had 'Add' 10 rows. I want to add these 10 rows into database. How should i do?
I have been searching for codes. But the result not what i want.
Can you pls help. Thanks in advanced.
Here is my codes that stuck half way:-
Dim strQuery1 As String
strQuery1 = "Insert into MMBarCode (HBarCode,EMIBarCode) values('" & DataTable.Rows(HBarCode) & "','" & DataTable.Rows(EMIBarCode) & "')"
myConnection.Open()
myCommand = New SqlCommand(strQuery1, myConnection)
Try
ra = myCommand.ExecuteNonQuery()
myConnection.Close()
Me.Close()
Catch ex As Exception
myConnection.Close()
MessageBox.Show(ex.Message)
End Try
Thanks, eunice
|
|
|
|
|
This is a SQL statement that is witten in Access for parameter search with wildcard
...
WHERE (((SLUŽBA.Priimek) Like "*" & [Search text] & "*"));
why doesn't it work in a Visual Basic Querry? I write the same expression in Function field and it doesn't work. Any suggestions?
Thanks.
|
|
|
|
|
In SQL - sytax this becomse something like
WHERE (SLUŽBA.Priimek LIKE %[Search text]%)
(% <=> * and no &)
|
|
|
|
|
Well, hard to understand what you mean by a 'Visual Basic Querry', but if you're building a string, you need to deal with how to represnt quotes for a start.
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 guys
i am running dotnet 2 exe file from network but it doest not run on my system , it says something
security like exception, but if i make my intrantet setting from dotnet framework2 configuration to gullytrusted it runs fine, but in this way i will have to make this setting on individual system, how to i do avoid from this issue,is there any that dotnet bypass the security or we can run our exe on tuntime in the fully trusted zone, thanks in advance
hello
|
|
|
|
|
First: there is no workaround IN code (that's what CAS is for)
As you said yourself: you either have to put the folder in the trusted zone / put the assembly in there or get some company policies for this task. However you will need to set these settings on ever client.
Of course if you copy the exe to local disks - say with a batch file before starting ...
|
|
|
|
|
Hi, I just want to know if it would be advised to put the following at the end of this code:
Set objFSO = CreateObject("Scripting.FileSystemObject")<br />
Set objOutFile = objFSO.OpenTextFile("\\jhbtest01\e$\SARS\Script\FileWithFilePath\FileNameFormA.txt", 2, True)<br />
strLine = FileName<br />
objOutFile.WriteLine strLine
Should i add this at the end:
objOutFile.Close AND is this the right way of doing the close section??? (it is working without it but i get error... so it works the first time round but fails second time round... without me seeing the error.)...
Oh yeah... this bit of code is in a javascript file that i call through VB.Net using the Shell()
"Many of life's failures are people who did not realize how close they were to success when they gave up." Thomas A. Edison
|
|
|
|
|
Support123 wrote: Should i add this at the end:
objOutFile.Close
Yeah, that would probably be a good idea.
Support123 wrote: it is working without it but i get error...
And that error would be ....??
Support123 wrote: so it works the first time round but fails second time round...
This is probably because you didn't close the file and are trying to open it again.
Support123 wrote: this bit of code is in a javascript file
No, it's not. This is code snippet you posted is VBScript.
|
|
|
|
|
Support123 wrote:
this bit of code is in a javascript file
No, it's not. This is code snippet you posted is VBScript.
sorry about that... i was thinking one thing and writing another. I had a java question too (i am working on a ssis project and asp.net project so i messed up the question).
i appologize and thank you for the info. I will add the objOutFile.Close() section to the VBSript. (i dont know what the error is exactly... it is not displaying anything of use... it is saying that i have issues in one of my script files (vb.net) in the ssis package but it is working fine through visual studio... Only a problem when it is ran through a job in sql, so i thought that maybe the VBScript needed to be tweeked a bit.)
I will test to see if it works.
Thank you for your time.
"Many of life's failures are people who did not realize how close they were to success when they gave up." Thomas A. Edison
|
|
|
|
|
Hi,
I'm developing a network application for a windows CE 5.0 device.
I need to visit a certain http:// url to process a php script. I have tried using process.start but that doesn't work.
So i'm using a webBrowser control to do the job.
The device is hooked to a usb cable on activeSync sharing the PC's internet connection. The connection works. ( I tried tracert somesite.com and it returned 30 hops.)
I'm using this code:
Dim uri As New System.Uri("http://www.somesite.hr/subfolder/index.php")
WebBrowser.Navigate(uri)
This code is on a button's click event. ( it works the same way on .net framework 2.0 but not the compact)
I keep clicking, and the code executes but the web browser is empty, nothing happens.
Any ideas?
Thank you!
|
|
|
|
|
unix_master01 wrote: ( I tried tracert somesite.com and it returned 30 hops.)
30 hops?? The only way you should get that may hops to a web site is if you bounced the signal off of Mars and through NASA's Deep Space Communuications Network.
It would appear as though the packets are getting looped through the same set of hops, over and over again. This would indicated that there's something wrong with your network setup somewhere.
|
|
|
|
|
Any one can help.? a i'm new in vb.net i have a problem to shutdown, rebot and display screenshot of certain computer in local group by intering ip their address. heres my problem..!
=>> A program that will ask the user to input an IP address and then capture the screenshot of the computer,restart,shutdown, the computer will the given IP address.
Hope Anyone can help me here.? Thanks and have a nice day..
God Bless....?????
|
|
|
|
|
IF you have a username and password, you can remote desktop to machines that support that, with an IP address. I don't know if it's possible through code.
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 )
|
|
|
|
|
Christian Graus wrote: . I don't know if it's possible through code.
Actually there is a Microsoft provided utility called shutdown.exe (shutdown -i) invokes a 'Remote Shutdown Dialog'. But I am not sure whether that can be automated though.
Vasudevan Deepak Kumar
Personal Homepage Tech Gossips
A pessimist sees only the dark side of the clouds, and mopes; a philosopher sees both sides, and shrugs; an optimist doesn't see the clouds at all - he's walking on them. --Leonard Louis Levinson
|
|
|
|
|
angelo07 wrote: =>> A program that will ask the user to input an IP address and then capture the screenshot of the computer,restart,shutdown, the computer will the given IP address.
Are you intending to make something like 'Remote Shutdown Dialog ' which gets invoked using shutdown -i from Windows XP onwards?
Vasudevan Deepak Kumar
Personal Homepage Tech Gossips
A pessimist sees only the dark side of the clouds, and mopes; a philosopher sees both sides, and shrugs; an optimist doesn't see the clouds at all - he's walking on them. --Leonard Louis Levinson
|
|
|
|
|
Hi all,
I'm using VB.net and currently I want to do a depositary which allow people to upload file to it. I researched and found a lot of resources, which they did using ASP.NET
1) Can VB.net - Window Form create depositary (upload files (.doc, .txt ..), etc?) [i know asp.net is also like under vb.net group, but the codes are kinda different, some functions only work for one but not for the another]
2) If yes, how do I do it? (cos' ASP.net uses localhost, how about general VB.net - Window Form)? Where would the files be uploaded to?
I hope I'm not too vague. Any help is appreciated. Thanks in advance.
telly
|
|
|
|
|
tellytub wrote: Where would the files be uploaded to?
Good question. You can do it, if you have an FTP site set up to copy the files to.
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 )
|
|
|
|