|
|
You have to supply the arguments seperate from the path to the .EXE:
Process.Start("C:\folder\filetorun.exe", "-verify")
|
|
|
|
|
I am trying to call a DataTable in one Public Sub from another Public Sub. The IDE is giving me the error 'Name 'dt' is not declared'.
How can I pass this DataTable from one Public Sub to another?
Thanks,
Dan
|
|
|
|
|
where did you declare the DataTable and what its access modifier ??
When you get mad...THINK twice that the only advice
Tamimi - Code
|
|
|
|
|
Here are my two subs, both subs' access are public.
<br />
Public Sub DiseaseList(ByVal connectionString As String)<br />
'Disease List<br />
Dim strSQLDiseaseList As String = "Select DiseaseName, DiseaseCode, SurveillanceFormFlag, TwentyFourHRReportFlag, CausativeOrganismFlag, SerotypeFlag, SiteOfInfectionFlag From Disease"<br />
Dim daDisease As New OleDbDataAdapter(strSQLDiseaseList, connectionString)<br />
Dim dtDisease As New DataTable("Disease")<br />
<br />
<br />
Try<br />
daDisease.Fill(dtDisease)<br />
Catch ex As Exception<br />
MessageBox.Show(ex.Message)<br />
End Try<br />
<br />
<br />
With cboDiseaseName<br />
.DropDownStyle = ComboBoxStyle.DropDownList<br />
.DataSource = dtDisease<br />
.DisplayMember = "DiseaseName"<br />
.ValueMember = "DiseaseCode"<br />
.SelectedIndex = cboDiseaseName.FindStringExact("")<br />
End With<br />
'End Disease List<br />
End Sub<br />
And here is the second, this one is trying to see values of the datatable dtDisease.
<br />
Private Sub cboDiseaseName_SelectedValueChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles cboDiseaseName.SelectedValueChanged<br />
<br />
Dim dvFilter As DataView = Nothing<br />
<br />
dvFilter = dtDisease<br />
<br />
<br />
End Sub<br />
|
|
|
|
|
In your case, you would have to move the declaration for dtDisease to class-scope to do this:
Public Class MyForm
Inherits System.Windows.Forms.Form
Private dtDisease As DataTable
Public Sub DiseaseList(ByVal connectionString As String)
'Disease List
.
.
dtDisease = New DataTable("Disease")
.
.
End Sub
Private Sub cboDiseaseName_SelectedValueChanged(ByVal sender As Object, ByVal e As System.EventArgs) _
Handles cboDiseaseName.SelectedValueChanged
Dim dvFilter As DataView = Nothing
dvFilter = dtDisease...
End Sub
|
|
|
|
|
Hi,
I posted this message last week but didn't get any reply.
Maybe my question was not clear, so here it comes again:
I made a vb6 application which reads a html file from
the WWW and writes this html file to disk
using the URLDownloadtoFile of "URLMON.DLL".
Then the application reads the file and put the content
of this file in a single string.
Next the application will manipulate the string for special
purposes.
I now am looking for a solution to skip the write and
read to/from disk and fill the sting directly.
I suppose this could be done with the URLOpenStream or
URLOpenPullStream functions of "URLMON.DLL".
I couldnot get this working.
Please can anybody give me a clue or, if possible, provide me with
an example?
Thanks in advance.
Hans Vanmeel
|
|
|
|
|
You didn't get a reply because none has any experience with UrlMon and VB6. There's not examples that I could find in VB6 that use any of the UrlMon URL to Stream functions.
I don't have any examples and I don't have VB6 any longer either.
If you were using VB.NET, this would be very easy using the built in classes of the .NET Framework.
|
|
|
|
|
A manager wanted to know how to subtract working days from an actual date. The only problem is the second date is not a date, but a number.
For example:
Date1: 01-July-2007
He wants to know what the date would be if we subtract 10 working days. Excel will take the date minus 10 no problem, and it will calculate working days between two actual dates, but I cannot figure out how to finagle this thing to automatically subtract working days without intermediate steps. Is there a non-documented function like DATEDIF in excel that might help?
______________________
stuff + cats = awesome
|
|
|
|
|
I seem to remember a Workday function in Excel...
|
|
|
|
|
The only thing is that you have to put two dates, like workdays (01-Jan-2007, 31-Jan-2007). I tried using a number for the second value and it bombed out.
______________________
stuff + cats = awesome
|
|
|
|
|
leckey wrote: The only thing is that you have to put two dates, like workdays (01-Jan-2007, 31-Jan-2007). I tried using a number for the second value and it bombed out.
Actually no, the second parameter _is_ a number, by definition of the Workday function. A negative integer gives a past date, and a positive one a future date.
What probably happened was that the cell was not formatted as a date. Did you try "Format Cells - Date"?
Hope this helps.
|
|
|
|
|
exstis a free sirte offer complete gui to use in visual basic.
Tks.
|
|
|
|
|
What?? You want some web site that offers a complete GUI for any application?? That's not possible. I think you're talking about graphics skins, changing the look of the application??
|
|
|
|
|
Please Help with VB.NET!
I have a datagrid, and it has ButtonColumn . I have the function ItemCreated for this Button. I want to pass the value of the cell of that row in the datagrid to clientside javascript. I want to confirm the user with the information of the row before they delete that row. It seems like the Javacript of the "onclick" event always fired before the ItemCreated event, that is why i can not get the the value of the row at all. I've tried many different way but i could not get it. Please help me with this. I really appreciate your help very much.
Sub dgProgram_ItemCreated(ByVal sender As Object, ByVal e As DataGridItemEventArgs)
If e.Item.ItemType = ListItemType.Item OrElse e.Item.ItemType = ListItemType.AlternatingItem Then
Dim lbl As New Label
lbl = CType(e.Item.FindControl("lblProgram"), Label)
//program is a hidden field
Me.program.Value = CType(lbl.Text, String)
Dim btn As Button
btn = CType(e.Item.Cells(14).Controls(0), Button)
btn.Attributes.Add("onclick", "return deleteconfirm(program)")
End If
End Sub
function deleteconfirm(v)
{
return confirm('Are you sure to delete this program: '+ v.value);
}
|
|
|
|
|
This question belongs in the ASP.NET forum[^]. It really has nothing to do with VB.NET itself. It's more along the lines of ASp.NET technology.
|
|
|
|
|
He's already asked it there already.
______________________
stuff + cats = awesome
|
|
|
|
|
I don't have a direct answer to your problem but we solved exactly the same problem by using ASP.NET AJAX, GridView with a Template Cell that contains a Button and a ConfirmationExtender - really simple this way.
Maybe you want to take a look at http://ajax.asp.net
-^-^-^-^-^-
no risk no funk
|
|
|
|
|
I have a VB Script that can lookup a record in an Access database and return values of other fields if it finds a matching record. I would like to mofify it to do the same thing for a MySQL database. Any ideas?
Code Below:
Dim connectionString
Dim clientname
connectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=E:\Kyocera Stuff\SFKYO FOLDERS\SFKYO\Clients.mdb;Persist Security Info=False"
function Initialize(UserName, EmailAddress)
end function
function InitializeField(fieldName, fieldValue)
If fieldName = "Client Name" then
InitializeField = clientname
exit function
end if
InitializeField = ""
end function
function GetRecordSet(clientnumber)
Dim rs
Dim conn
set conn=CreateObject("ADODB.Connection")
conn.ConnectionString = connectionString
conn.Open
set rs =CreateObject("ADODB.Recordset")
rs.Open "select * from Clients where [Client Number]='" + clientnumber + "'", conn
set GetRecordSet = rs
set rs = Nothing
set conn = Nothing
end function
function ValidateField(fieldName, fieldValue)
Dim rs
If fieldName = "Client Number" then
set rs = GetRecordSet(fieldValue)
If rs.EOF then
ValidateField = "Client number " + fieldValue + " not found"
exit function
end if
rs.MoveFirst
clientname = rs.Fields("Client Name").Value
ValidateField = ""
exit function
end if
ValidateField = ""
end function
'MsgBox ValidateField("Client Number", "RAGE7765")
Vichammer
|
|
|
|
|
|
Hi,
I am working with VB.NET on .NET 1.1, and I am not too familiar with it.
When I add a drop down list to the .aspx page, it creates the following code in the page behind:
Protected WithEvents ddlID As System.Web.UI.WebControls.DropDownList
Now I want to go and populate this drop down in a method like this:
ddlID = Me.CreateDropDownListForFileFields(columns)
columns are the columns from a dataset and the function CreateDropDownListForFileFields creates items for all the columns and returns a drop down list.
..but ddlID does not display anything. Why is this?
Please can some help?
Regards
ma se
|
|
|
|
|
u have to specify the datasource, do databind, specify datavalue and datatext field
ddlist.DataSource = dataset1.Tables(0)
ddlist.DataBind()
ddlist.DataValueField = "column name"
ddlist.DataTextField = "column name"
Thanks
Warm Regards
Prakash-B
|
|
|
|
|
You don't understand!!
I have the following piece of code:
Protected WithEvents ddlID As System.Web.UI.WebControls.DropDownList
In a method where I try to populate this drop down list:
ddlID = Me.CreateDropDownListForFileFields(columns)
CreateDropDownListForFileFields looks like this:
Private Function CreateDropDownListForFileFields(ByVal columns As DataColumnCollection) As DropDownList
Dim ddl As New DropDownList
Dim column As DataColumn
For Each column In columns
ddl.Items.Add(New ListItem(column.ColumnName, column.ColumnName))
Next
ddl.Items.Insert(0, New ListItem("Please select...", String.Empty))
' Return
Return ddl
End Function
Please see if you can help me know.
Regards
ma se
|
|
|
|
|
This question really should have been asked in the ASP.NET forum, reguardless of the language you used.
But, in Windows Forms, any control must be added to the form's Controls collection. I'm guessing that the same is true for an ASP.NET Form.
Me.Controls.Add(ddl)
|
|
|
|
|
Hi
How to read the email address from the inbox folder of outlook into vb.net?
am using .net1.1 version.Please guide me in solving this query.
Thanks
Aruna
|
|
|
|