|
Hi,
Can you send me that code(java script)and let me know where i need to add that code.
thank you
Ashish K. Vyas
|
|
|
|
|
<script language="javascript"><br />
history.forward();<br />
</script>
|
|
|
|
|
i am having this error when i am about to delete a data row
inline with this is a message box saying:
object reference not set to an instance of an object. do you want to correct the value?
if i click yes, it will delete the row if no it will ignore the deletion
i've already checked all of my declarations and pretty sure that i've declared everything right.
here's my code:
Private Sub delCol_ButtonColumnClick(ByVal sender As Object, ByVal e As Leadit.ExtendedDataGrid.ButtonColumnEventArgs) Handles delCol.ButtonColumnClick
Dim row As Integer
Dim hourdiffBtn As Integer
Dim sBtn As DateTime
Dim eBtn As DateTime
Dim res As MsgBoxResult
row = Me.dtgCustomSched.CurrentRowIndex
res = MsgBox("Are you sure you want to delete the schedule on " + Me.dtgCustomSched.Item(row, 0), MsgBoxStyle.YesNo)
If res = MsgBoxResult.Yes Then
sBtn = Date.Parse(Me.dtgCustomSched.Item(row, 1))
eBtn = Date.Parse(Me.dtgCustomSched.Item(row, 2))
hourdiffBtn = getHrValue(sBtn, eBtn)
lastRowNumber = lastRowNumber - 1
Me.remainingHour2 = Me.remainingHour2 + hourdiffBtn
Me.txtLookUpHours.Text = remainingHour2.ToString
addSchedule.Table("ttcpcustomizedschedule").Rows.RemoveAt(row)
Else
Exit Sub
End If
End Sub
dtgcustomsched is the name of my datagrid
addsched is the name of the dataset
i made one of the datagrid cell as a customized button.. it already work fine with my other codes.. the problem only occur here
the error occurs on the line in bold.
also, this error only appears when i delete the last row on the datagrid, but if i delete anything rather than the last row everything works fine and no error is being detected
please help. thanx!
i am using vb.net 2002
|
|
|
|
|
cutequencher wrote: addSchedule.Table("ttcpcustomizedschedule").Rows.RemoveAt(row)
Most likely problem is that the Table call is returning null/nothing. Something sure is.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
maybe youre right but im confuse because when i click yes it continue to delete the row but with that error mesage. ive read some thread and says that its a bug on vb.net 2002 datagrid, but then i still need to resolve it, i just wonder if there is a way to disable the autocommit of datagrid? thanx!
|
|
|
|
|
Hi all,
Sorry to be a pain and this may just be a simple answer but I can't seem to find out how to do it.
I'm am currently developing some GIS software, I have the basic toolstrip above the map with all your tools eg Pan, zoom etc. The problem is that I can't seem to find how to have a toggle button on the toolstrip so when Pan is select, the button is pushed down and what ever was select pops back up.
This seems like a simple thing, it would be a bit strange if I had to do it in code.
Thanks for you help
Nathan
|
|
|
|
|
Do you have a sample of your code where you think it should be working?
"Any sort of work in VB6 is bound to provide several WTF moments." - Christian Graus
|
|
|
|
|
I want to be able to force a system rightclick. Is there a way to do that?
|
|
|
|
|
yes. try to use the "keys" properties.
|
|
|
|
|
First, you're going to have to describe what you mean by a "system right-click".
|
|
|
|
|
I want to force a right-click so my program will bring up the contextmenu.
|
|
|
|
|
So call the Show method on the ContextMenu you want to show. You don't need to "force a right-click".
|
|
|
|
|
Hi
I have created a create user login function
which creates a random salt for each individual user and stores it into my mySQL database along with a salted hashed password
I enter all the data into my database thru a stored procedure
i keep on getting an odd error
That my procedure expected 7 parameters and only received 6
Altho my code is definetly passing 7 parameters accross to the database, on debuggin the parameter count is also equal to 7, it doesn't make sense, probably somthin stupid
can anyone see the problem
Cheers
Boy
my procedure is
CREATE DEFINER=`jshort`@`localhost` PROCEDURE `sp_myinsertUsers`(IN p_userName varchar(20), IN p_password varchar(200),IN p_salt varchar(200),IN p_firstName varchar(20), IN p_lastname varchar(200),IN p_phone integer(12), IN p_mail varchar(200))
BEGIN
INSERT INTO users(userName,Password,salt,user_firstName, user_lastName, user_phone,user_mail)VALUES(p_username, p_password,p_salt, p_firstname, p_lastname, p_phone, p_mail)
;
END
my code is as follows
Sub send_loginCreds(ByVal sender As Object, ByVal e As EventArgs)
Dim litErr As New LiteralControl
Dim shaHash As New System.Security.Cryptography.SHA384Managed()
Dim hashedBytes As Byte()
Dim encoder As New UTF8Encoding()
Dim data() As Byte
data = New Byte(6) {}
Dim rng As New RNGCryptoServiceProvider
rng.GetBytes(data)
Dim PSalt As String = Convert.ToBase64String(data)
'Create connection string to pass database, string holds login information to mySQL,
Dim connectionString As String
connectionString = "Server=localhost; ;database=ftp1;"
'Builds .net mysql connection and passes connection string into method
Dim connection As New MySqlConnection(connectionString)
'Create mySql command string for passing query or SPROC(Stored Procedure)
Dim cmdString As New MySqlCommand
'Set Command to equal mySql connection,t so can pass SQL query
cmdString.Connection = connection
Try
'Set command string to equal SPROC
cmdString.CommandText = "sp_myInsertusers"
'ONLY PLACE THIS IF SPROC, sets the command to a SPROC
cmdString.CommandType = CommandType.StoredProcedure
Dim param As New MySqlParameter
param = cmdString.Parameters.Add("?p_username", MySqlDbType.VarChar)
param.Direction = ParameterDirection.Input
param.Value = txtFirstName.Text
'encrypt(password)
hashedBytes = shaHash.ComputeHash(encoder.GetBytes(txtPassword.Text))
Dim PWhash As String = encoder.GetString(hashedBytes)
param = cmdString.Parameters.Add("?p_Password", MySqlDbType.VarChar)
param.Direction = ParameterDirection.Input
param.Value = PWhash
param = cmdString.Parameters.Add("?p_salt", MySqlDbType.VarChar)
param.Direction = ParameterDirection.Input
param.Value = PSalt
param = cmdString.Parameters.Add("?p_firstname", MySqlDbType.VarChar)
param.Direction = ParameterDirection.Input
param.Value = txtFirstName.Text
param = cmdString.Parameters.Add("?p_lastname", MySqlDbType.VarChar)
param.Direction = ParameterDirection.Input
param.Value = txtLastName.Text
param = cmdString.Parameters.Add("?p_phone", MySqlDbType.VarChar)
param.Direction = ParameterDirection.Input
param.Value = txtPhone.Text
param = cmdString.Parameters.Add("?p_mail", MySqlDbType.VarChar)
param.Direction = ParameterDirection.Input
param.Value = txtMail.Text
'Insert the records into the database
connection.Open()
cmdString.ExecuteNonQuery()
connection.Close()
Catch ex As Exception
litErr.Text = ex.Message
MsgBox(ex.Message)
End Try
Server.Transfer("userhome.aspx")
End Sub
|
|
|
|
|
boyindie wrote: 'encrypt(password)
hashedBytes = shaHash.ComputeHash(encoder.GetBytes(txtPassword.Text))
Dim PWhash As String = encoder.GetString(hashedBytes)
param = cmdString.Parameters.Add("?p_Password", MySqlDbType.VarChar)
param.Direction = ParameterDirection.Input
param.Value = PWhash
Might be the problem. In your stored proc it is p_password, and in the vb code is it p_Password. Not sure if it is case sensitive or not.
"Any sort of work in VB6 is bound to provide several WTF moments." - Christian Graus
|
|
|
|
|
No,
I think it has somthin to do with my salt, as it was all working perfectly until i put the code for creating, converting and passing my salt value into database
|
|
|
|
|
Is the string PSalt staying under 200 characters in length?
"Any sort of work in VB6 is bound to provide several WTF moments." - Christian Graus
|
|
|
|
|
Are any of the parameter values an empty string??
|
|
|
|
|
Discovered problem, the actual value of my salt field in database wasn't long nuff for some reason had it only set to 50.
Been at this too long i thinks, although i now have my page working
Cheers People
|
|
|
|
|
Glad it sounds like you got it figured out
"Any sort of work in VB6 is bound to provide several WTF moments." - Christian Graus
|
|
|
|
|
well no1 whose got a girlfriend is goin to be hacking my passwords anytime soon
|
|
|
|
|
I noticed you were using SHA384 , and that should be plenty sufficient for some time
"Any sort of work in VB6 is bound to provide several WTF moments." - Christian Graus
|
|
|
|
|
I'm working on my first vb.Net project I have a field that is not required, but is numeric. If the user leaves the field blank I get the following error, when I try to use it set a value in my object.
InvalidCastException: Cast from string "" to type 'Integer' is not valid.]
Here is the code.
MyShelled.KC = Me.txtKC.Text
Here is the object's property
Public WriteOnly Property KC() As Integer
Set(ByVal NewVal As Integer)
MyKC = NewVal
End Set
End Property
I've tried to create overloaded properties but I get the following compile error.
c:\inetpub\wwwroot\Shelling\clsZebra.vb(228): 'Public Overloads WriteOnly Property KC() As Integer' and 'Public Overloads WriteOnly Property KC() As String' cannot overload each other because they differ only by return types.
I'd like to handle this in my class but I'm not sure how to go about. Any direction would be great.
Thanks
Travis
|
|
|
|
|
If Not IsNothing(Me.txtKC.Text) AndAlso me.txtKC.text.trim <> String.Empty Then
MyShelled.KC = Me.txtKC.Text
End If
|
|
|
|
|
FYI, to handle in your class, you would need to define your property as an object so that it can accept different datatypes like strings and numbers, etc. then filter out anything you don't want to allow like empty strings, etc.
|
|
|
|
|
mymacryan wrote: MyShelled.KC = Me.txtKC.Text
This happens because VB is weakly typed ( aka sucks ). You need to set a default value if the string is empty. One way to do this is to pretend it's strongly typed and use int.TryParse to see if you get an int out of it, and otherwise set a default. This has the advantage of not assuming your presentation layer has only allowed numbers to be entered.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|