|
Use Directory.GetDirectories passing in the directory you want to start your search from.
Dim returnPath As String() = Directory.GetDirectories(txtDirectory.Text)
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Thank you,
i put this onto the button and altered it slighty
Dim returnPath As String() = System.IO.Directory.GetDirectories(txtdirectory.Text)
and that seems ok, dont i need a loop though to display each directoryname in turn?
thanks
|
|
|
|
|
If you like to click OK and close a lot of MessageBoxes go ahead and put it in a loop...
Otherwise string.Join all filenames (with Environment.NewLine) and show them all at once.
Luc Pattyn [Forum Guidelines] [My Articles]
this weeks tips:
- make Visual display line numbers: Tools/Options/TextEditor/...
- show exceptions with ToString() to see all information
- before you ask a question here, search CodeProject, then Google
|
|
|
|
|
yes i want to click ok to a lot of boxes, because then i want to progress the code from passing each one into a messagebox into something else.
please can you help?
thank you
|
|
|
|
|
Hi,
I have a gridview control in which i have added two comboboxes(cmbCity,cmbPincode) at the runtime.I populate the cmbCity combobox from the database at the form load event.
Now my requirement is that when ever i select an item from cmbCity ,the relevent picode should be automatically populated into cmbPincode.
Please help me out how to handle the cmbCity_SelectedIndexchanged event inside a gridview control..
Pradip kishore
|
|
|
|
|
Here is the problem:
I use Adodc control in vb6.0 to access sql server,everything works fine until when the network failed.
the code simply like this:
On Error ErrHandle
Adodc1.ConnectionString = "Provider=SQLOLEDB.1;user id=sa;password=123456;initial catalog=test;data source=192.168.1.23\SQLEXPRESS;Connect Timeout=30"
Adodc1.Recordset.Properties("prompt") = adPromptNever
Adodc1.RecordSource = "select *from admin"
Adodc1.Refresh
'other code
ErrHandle:
'do nothing
when the code run to Adodc1.Refresh,it pop up an error dialog with message "[DBNETLIB][ConnectionOpen (Connect()).]SQL Server Not Exist or Access Denied"
It's normal that you can't access data base when the network is not working,but since my program is runing at the server host I don't want it to click the dialog all the time when it can't connect to sql server.
So is there some way that can avoid the error dialog? and let it goto ErrHandle Section
I have being run into this problem for several months, any advice would help.
thank you.
polarstar
-- modified at 4:02 Monday 24th September, 2007
|
|
|
|
|
Hi,
I am a beginer and I am trying to create a simple web browser using Visual Basic 2005 Express Edition.
What I need is this browser should be configured to use specific Java. That is the browser should use ONLY Java 1.3.1 or ONLY Java 1.4.2
As web browsers like IE can load Java applets, I want to do the same but restrict the version of Java used (example use only Java 1.3.1)
To make it easier to understand what I want .... here is the scenario....
The website to be accessed is an internal company website which uses an applet which runs only on Java 1.3.1
So the users of this website have to constantly disable the other java versions and restart their browsers just to be able to use this website. Due to unknown reasons the applet on this website cannot be upgraded at this time. So the only other solution is to make the browser use only Java 1.3.1 when accessing this website.
To make things easier for the users, I am trying to create a simple browser which uses only java 1.3.1 by default.
Is this possible?
Thank You for your help.
|
|
|
|
|
AFAIK the WebBrowser class uses the code and the settings of Internet Explorer,
so if you don't want to change IE's settings, that will not solve it.
My suggestion would be to install one more Internet Browser (FireFox, Safari, Maxthon, ...)
and change its settings to your specific requirement, then use that browser for your
intranet. That will be much easier than creating a whole new browser from scratch!
Luc Pattyn [Forum Guidelines] [My Articles]
this weeks tips:
- make Visual display line numbers: Tools/Options/TextEditor/...
- show exceptions with ToString() to see all information
- before you ask a question here, search CodeProject, then Google
|
|
|
|
|
Warning 1 Unable to apply publish properties for item "axinterop.mscomctllib".
Warning 2 Unable to apply publish properties for item "axinterop.msforms".
Warning 3 Unable to apply publish properties for item "interop.mscomctllib".
Warning 4 Unable to apply publish properties for item "interop.msforms".
Warning 5 Unable to apply publish properties for item "msdatasrc".
***************
anybody there who can explain how to fix this warning message in VB2005 Express... Everytime i build or rebuild my VB Form project, it always warn me that kind of message.. but no error's message just a warning.. and my executable application still works..
but that is still a warning that means there is/are something missing or lacking in my project that needs attention..
Please help...
I think, I have already import all .dll's and com's i need in my vb project. but im not that so sure..
please be patient with me im just a newbie in VB programming this few months.. ehehe
|
|
|
|
|
When ever I try and add 'Microsoft Internet Controls' (which includes the Web Browser control) I get a message saying "File not found: 'C:\WINDOWS\system32\ieframe.dll\1'". Is there a way to get this back, because the Web Browser worked before.
Thanks in advance!
|
|
|
|
|
You can reinstall Internet Explorer. It usually updates all the dlls required for internet programming in VB6. Also its available for free download from Microsoft website.
when you want something, the universe conspires in helping you achieve it
|
|
|
|
|
hi guys,
can somebody help me and show me codes on how to save changes(in information) in datagridview connected to an SQL database. I was looking for codes ever since, but it doesn't work as i expected it to be.
I'm a beginner here, so I'm having a hard time creating the codes with datagridview.
Here's how it should work. I have DataSet1 and DataGridView1. When I run the program, i could add row/record to the datagridview, or edit, or delete record/s and save it onto the SQL database.
Hope anyone could help me here.
Thanks..;)
angeldeity
|
|
|
|
|
Abbhie wrote: can somebody help me and show me codes on how to save changes(in information) in datagridview connected to an SQL database. I was looking for codes ever since, but it doesn't work as i expected it to be.
I'm a beginner here, so I'm having a hard time creating the codes with datagridview.
Here is an example of how you can accomplish something like this:
Create two forms, call them Form1 and Form2. Put a DataGridView (DataGridView1) and a button (btnUpdateRow) on Form1. Create 3 textboxes on Form2 and call them txtId, txtFirstName and txtLastName.
Creating a sample dataset with 3 rows of data:
Public Table1 As DataTable<br />
<br />
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load<br />
Table1 = New DataTable("People")<br />
Dim Row1, Row2, Row3 As DataRow<br />
<br />
Try<br />
Dim Id As DataColumn = New DataColumn("Id")<br />
Id.DataType = System.Type.GetType("System.Int32")<br />
Table1.Columns.Add(Id)<br />
<br />
Dim FirstName As DataColumn = New DataColumn("First Name")<br />
FirstName.DataType = System.Type.GetType("System.String")<br />
Table1.Columns.Add(FirstName)<br />
Dim LastName As DataColumn = New DataColumn("Last Name")<br />
LastName.DataType = System.Type.GetType("System.String")<br />
Table1.Columns.Add(LastName)<br />
<br />
Row1 = Table1.NewRow()<br />
Row1.Item("Id") = 1<br />
Row1.Item("First Name") = "Pete"<br />
Row1.Item("Last Name") = "Soheil"<br />
Table1.Rows.Add(Row1)<br />
<br />
Row2 = Table1.NewRow()<br />
Row2.Item("Id") = 2<br />
Row2.Item("First Name") = "Bill"<br />
Row2.Item("Last Name") = "Gates"<br />
Table1.Rows.Add(Row2)<br />
<br />
Row3 = Table1.NewRow()<br />
Row3.Item("Id") = 3<br />
Row3.Item("First Name") = "George"<br />
Row3.Item("Last Name") = "Washington"<br />
Table1.Rows.Add(Row3)<br />
<br />
DataGridView1.DataSource = Table1<br />
Catch ex As Exception<br />
MessageBox.Show("Error: " & ex.Message)<br />
End Try<br />
<br />
End Sub<br />
Code to call the update Form2 and allow you to change row values:
Private Sub btnUpdateRow_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnUpdateRow.Click<br />
Dim SelectedRowIndex As Integer<br />
Dim SelectedRowCount As Integer = DataGridView1.SelectedRows.Count<br />
<br />
If DataGridView1.SelectedRows Is Nothing Then<br />
MessageBox.Show("Please Select a Row")<br />
Exit Sub<br />
End If<br />
<br />
If SelectedRowCount < 1 OrElse SelectedRowCount > 1 Then<br />
MessageBox.Show("Invalid Row Selection.")<br />
Exit Sub<br />
End If<br />
<br />
Dim SelectedRow As DataGridViewRow = DataGridView1.SelectedRows.Item(0)<br />
SelectedRowIndex = SelectedRow.Index<br />
<br />
Dim f As New Form2<br />
<br />
f.txtId.Text = SelectedRow.Cells(0).Value<br />
f.txtFirstName.Text = SelectedRow.Cells(1).Value<br />
f.txtLastName.Text = SelectedRow.Cells(2).Value<br />
f.ShowDialog()<br />
<br />
DataGridView1.Rows.Item(SelectedRowIndex).Cells(0).Value = f.txtId.Text<br />
DataGridView1.Rows.Item(SelectedRowIndex).Cells(1).Value = f.txtFirstName.Text<br />
DataGridView1.Rows.Item(SelectedRowIndex).Cells(2).Value = f.txtLastName.Text<br />
End Sub
I used a DataTable for my example, but if you want to use a dataset instead all you have to do is to add the datatable to a dataset and you are good to go.
Pete Soheil
DigiOz Multimedia
http://www.digioz.com
|
|
|
|
|
thanks for the reply.. i'll try these codes..
|
|
|
|
|
i have a simple doubt but i dont know how to do it..
actually i have displayed a database table in datagrid....
now i want to add or delete some values of data grid for dat i have given an edit button which opens a new form wid column name in labels and their values to be enterd in textboxes....
i want wen i click update button values get update with original datagrid window still opened..
database coding is not the deal..
important part is how can i update values of one form while focus on other form...
thanks in advance....
|
|
|
|
|
hi friends,
i'm new to reporting in win app.. so i need a great help.. my problem is..
i want to show a report that populate data from two tables. & i used the sql query like this.
dim _Ssql as string=""
_Ssql="Select d1.id, d1.name, c1.name from Dress d1, Color c1 where " _
& " c1.id=d1.c and d1.id=10 "
Hope u got my query...
i'm using the sql server , so i created a crystal report and add the fields from the two tables. now i used the below code to show the report
dim objds as new Dataset
dim _Cconnect as new GetConnection
objds=_Cconnect.GetAll(ssql)
dim crt as new Report1
crt.setDatasource(objds)
CrystalReportViewer1.ReportSource=crt
The main problem is when show the report it displays all the records.. but its not taking the data from dataset. ie it should show only 1 record.. How can i resolve this...
cheers...
|
|
|
|
|
need help.. How can I display the item or the currentcell that I doubleclickd in the datagridview in a textbox.. can somebody send me a code for that.. or how can I show the form displaying the details of the current cell I doubleclickd.
I have a project that is an inventory system.In my database I have a table called ComputerUnits, the fields are serialNo, itemDescription, itemCategory, dateAcquired,etc. I displayed all the serialNo's from my database in a datagridview. The problem is, how to display the information of a specific serialNo in a another form by doublecliking that serialNo in the datagridview. I'm just a beginner so pls help...
im using win app..
tnx a lot
gt
|
|
|
|
|
Use the CellDoubleClick event handler. It will have an argument e , which is System.Windows.Forms.DataGridViewCellEventArgs type. From there, e.RowIndex will give you the row, and e.ColumnIndex will give you the column. I trust you can take it from there to fetch the data.
"Try asking what you want to know, rather than asking a question whose answer you know." - Christian Graus
|
|
|
|
|
r u using win app or web app..
|
|
|
|
|
He didn't say in his original post. I assumed Windows app.
"Try asking what you want to know, rather than asking a question whose answer you know." - Christian Graus
|
|
|
|
|
well, if it is Win app i used the code ..
Dim selected as DataGridCell
selected =DGlist.Currentcell
dim selectedItem as Object
selectedItem =DGlist.Item(selected.Rownumber,0)
Dim cellValue as integer
cellValue = CInt(selectedItem)
cheers....
|
|
|
|
|
hi
i want to know is it necessary to use printdialog,printpreview control for crystal report in vb.net2005? if yes then how it is use?
& one more question is that what is the difference between crystalpreview dialog control & printpreview ?
-- modified at 8:50 Sunday 30th September, 2007
Thanks
bye
|
|
|
|
|
I want to share some media files over LAN. I generated a list box which shows the list of files on my computer. I planned that when the user click on any filename mean when the listbox1 selectedindexchanged client computer automatically start VLC media player and start playing that file without asking any manual assistance from client.
I successfully generated file list on listbox1 which provide full path to the file when click on it mean ftp://server/media/filename.mp3
I use this code to activate the VLC media player
Private Sub ListBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ListBox1.SelectedIndexChanged
Dim furl As String = "ftp://speedexbb/media/" & ListBox1.SelectedItem.ToString
With Process1
.StartInfo.FileName = My.Computer.FileSystem.CombinePath(My.Computer.FileSystem.SpecialDirectories.ProgramFiles, "videolan\vlc\vlc.exe")
.StartInfo.Arguments = furl
.Start()
End With
End Sub
Please help that is there anything wrong. as the VLC made error that unable to open file. how can i get ride of this.
I will be gratefull for kind support
miss Juliana
|
|
|
|
|
Have you tried launching the file, from the FTP server in VLC??
I'm willing the bet that VLC player can't play a file from an FTP server. In that case, you'd have to download the file to the local hard drive, then play the file from that.
|
|
|
|
|
Hi friends,
i'm new in windows application. can u please give me an idea about the crystal report generation. i searched lot but in confusion..different articles in different ways.. help me please
cheers..
|
|
|
|