|
I don't think VB has any password Dialog Forms pre made so you would have to build a new form with a password box and pop it up when the unload event is raised. Then you can check the password with the hardcoded one.
Kevin
|
|
|
|
|
i know this is vb forum but i am really struggling with this subject and i tihnk this is probably the best forum i know of to get advice.
Types of actual and formal var parameters must be identical
this error message is appearing when i call a function within another function.
Does any one know what would cause this?
And also i and getting an Incompatible types: 'String' and 'Integer'
for an integer but i have declared both the variables as ints and i am jsut passing one into the other,
i would really appreciate any help and if anyone would like me to be more specific jsut ask.
Thanks nicci.
-- modified at 16:34 Monday 27th November, 2006
to err is to be human but to really foul things up you need a computer!
|
|
|
|
|
lil_nicci wrote: Does any one know what would cause this?
Because you are not using a value that has the same type as the parameter, or can not be automatically converted to that type.
lil_nicci wrote: And also i and getting an for an integer
What?
---
b { font-weight: normal; }
|
|
|
|
|
sorry that was a bit soft off me i comment out the error messages.
this is the function i have:
procedure TfrmStandardConversion.SplitPND1D2D3(const suppnco: String;
out D1S, D2S, D3S: Integer; out suppnc: String; out ErrorCode: Integer);
var
D1A, D2A, D3A: Integer;
supp_pnA: String;
begin
ErrorCode:=0;
//First we need to see if the var we are passed IS 19 long.
if (Length(suppnco)=19) then
begin
supp_pnA := StringReplace(Copy(suppnco, 1, 6), ' ', '', [rfReplaceAll, rfIgnoreCase]);
if (Length(supp_pnA) <> 6) then
ErrorCode:=3;
if (Length(StringReplace(Copy(suppnco, 9, 3), ' ', '', [rfReplaceAll, rfIgnoreCase])) = 0) then
ErrorCode:=4;
if (Length(StringReplace(Copy(suppnco, 13, 3), ' ', '', [rfReplaceAll, rfIgnoreCase])) = 0) then
ErrorCode:=4;
if (Length(StringReplace(Copy(suppnco, 17, 3), ' ', '', [rfReplaceAll, rfIgnoreCase])) = 0) then
ErrorCode:=4;
try
D1A := StrToInt(Copy(suppnco, 9, 3));
except
on Exception : EConvertError do
ErrorCode:=2;
end;
try
D2A := StrToInt(Copy(suppnco, 13, 3));
except
on Exception : EConvertError do
ErrorCode:=2;
end;
try
D3A := StrToInt(Copy(suppnco, 17, 3));
except
on Exception : EConvertError do
ErrorCode:=2;
end;
if (ErrorCode = 0) then
begin
suppnc := supp_pnA;
D1S := D1A;
D2S := D2A;
D3S := D3A;
end;
end else
ErrorCode:=1;
end;
and i want to extract the three D1S, D2S, D3S and suppnc
and i think i an getting stuck because of the contents of the parameters when i have called the function. do you know what i should put.
thank you btw!
to err is to be human but to really foul things up you need a computer!
|
|
|
|
|
How do you call the method?
---
b { font-weight: normal; }
|
|
|
|
|
I am trying to empty partnumber columns in sql database that have all zeroes so that the column will be blank. I am writing code through vb.net. Here is some code that I am using but it doesn't work:
Function:
Public Function Empty(ByVal supercedeto As String) As Boolean
Dim number As String
number = String.Empty(supercedeto)
End Function
Code:
If row("mostforwardpartnumber").ToString() = "0000000000000" Then
Empty(row("mostforwardpartnumber"))
End If
jds1207
|
|
|
|
|
Hi,
The function as you posted it here, does not return anything, nor does it affect anything outside itself.
jds1207 wrote: Public Function Empty(ByVal supercedeto As String) As Boolean
Dim number As String
number = String.Empty(supercedeto)
End Function
Does the column contain a set or random amount of zeroes?
jds1207 wrote: If row("mostforwardpartnumber").ToString() = "0000000000000" Then
Empty(row("mostforwardpartnumber"))
End If
If the amount of zeroes is always the same, you don't need a function to empty the row. Try something like this:
<br />
Dim EmptyNr as integer<br />
Dim rw as datarow<br />
For Each rw In YourDataSet.Tables(0).rows<br />
If rw.item("mostforwardpartnumber") = "0000000000000" Then<br />
rw.item("mostforwardpartnumber") = EmptyNr<br />
End If
Otherwise you'll need to write a function that checks the value of the column and based on what that function returns, you can then empty the cel.
Hope this helps you,
Johan
|
|
|
|
|
being new to VB.NET, how do you programmatically select a datagrid cell
silver-gray
|
|
|
|
|
Give This a try
<br />
Datagrid1.CurrentCell = new Windows.Forms.DatagridCell(row, col)<br />
Kevin
|
|
|
|
|
what I'm trying to do is programmatically select all cells in the 4th column that comtain nulls, and change the backcolor to red. I have vb.net 2003.
silver-gray
|
|
|
|
|
how to well write the below statement :
I got into the msgbox(ii) even the value of the called function
[getavailableswitch(checkStr)] is 0
Dim ii As Integer <br />
If ii = getavailableswitch(checkStr) <> 0 Then<br />
MsgBox(ii)<br />
End If
Note : i want the the following to be done within the same if
1-call the function
2-test the retrieved data from the function
Am i thinking correctly???
Regards
Ramy
|
|
|
|
|
i found that this statement goes right
ElseIf (i = getavailableswitch(checkStr)) And i <> 0 Then<br />
MsgBox(i)<br />
End If
i got my respone
thx anyway :
but is there any other way of thinkin?
Regards
Ramy
|
|
|
|
|
What type value does your function return?
Your function should return as an integer or else you would need to convert to an integer to test the return value
i.e.
function getavailableswitch(checkstr as string) as integer
return 1
end function
If Not getavailableswitch(checkStr) = 0 then
or
If getavailableswitch(checkStr) <> 0 then
or
if CInt(getavailableswitch(Checkstr)) <> 0 then
Moo
|
|
|
|
|
this is function that i m using and it returns an integer
Public Function getavailableswitch(ByVal checkstr As String) As Int16<br />
....<br />
getavailableswitch = cmd.ExecuteScalar()<br />
end function
what i want is: to call the above function and
thus
Dim id As Integer<br />
If id = getavailableswitch(checkStr) <> 0 Then<br />
MsgBox(id)<br />
End If
i know it sounds very bad,
Note i want to do withing the "if" statement
1-the call statement
2-the test on retreived data from the function
thx for your help
Regards
Ramy
|
|
|
|
|
i want to use dataset with created runtime to populate my report.i use this code
Classes_Obj.getRecord is return dataset
but this gives error as "The report has no tables"
could anyone help me
Dim aa As DataSet
aa = Classes_Obj.getRecord("select * from Frames")
ReportPurchase.SetDataSource(aa)
ReportViwer.rptContainer.ReportSource = ReportPurchase
'ReportPurchase.PrintToPrinter(1, False, 0, 0)
ReportViwer.ShowDialog()
-- modified at 9:08 Monday 27th November, 2006
|
|
|
|
|
Hi, The following code is generating an error....I have put comments in front of the line that generated error.
Can anybody help me in this?
Thanks,
Public Sub ConnectSQL()
Dim conn As New SqlClient.SqlConnection
Dim da As New SqlClient.SqlDataAdapter
da = SqlDataAdapter1 'This Adapter is manually created using the Wizard
conn = SqlConnection1 'This Connection is manually created using the Wizard
Dim selectCommand As New SqlClient.SqlCommand("SELECT cFName from PersonalDetails") 'Selecting The first column from the table
da.SelectCommand = selectCommand
Dim Reader As SqlClient.SqlDataReader
Dim RecordCount As Integer = 0
conn.Open()
Reader = selectCommand.ExecuteReader() 'This line is generating an error!!
Dim Records As String
While Reader.Read()
Dim i As Integer = 0
For i = 0 To Reader.FieldCount - 1
Records &= Reader(i) & "-"
Next
RecordCount += 1
End While
|
|
|
|
|
The Problem is you are not setting the connection or command type of your select command. Add these two lines right before you execure the reader
<br />
selectCommand.Connection = conn<br />
selectCommand.CommandText = CommandType.Text<br />
Hope this works
Kevin
|
|
|
|
|
Hi Kevin
I added the above lines of code. I am getting the same error.
However, Thanks for your help
|
|
|
|
|
Private Sub btnButtonvisible_MouseEnter(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnButtonvisible.MouseEnter
btnButtonvisible.Visible = False
End Sub
Private Sub btnButtonvisible_MouseLeave(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnButtonvisible.MouseLeave
btnButtonvisible.Visible = True
End Sub
End Class
shyamy
|
|
|
|
|
And your question is?
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Hi All,
One help.
I have the below function declaration.What is the default access specifier of the declaration.Is it private or public.
"Function FindDevice() As Boolean"
|
|
|
|
|
The default is Public . You can find out more here[^].
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
|
i m a student . and i want to make a software in asp.net.....
i want a simple topic which i can handel;P;P
hdfh
|
|
|
|
|
Well, we have no idea what you can handle. Have you done any study ? Read any books ?
Do you know how to work with a database ? If so, how about a CD list web app ? That's nice and simple.
Christian Graus - C++ MVP
'Why don't we jump on a fad that hasn't already been widely discredited ?' - Dilbert
|
|
|
|