|
Hello Rupesh Kumar,
I had done my thing using an example that u had sent me in prev. post and thanks again for your help.
and one more thing to ask to u that as u said to Farah sahad that if u encrypt yr key then its difficult to user to change that value. but here my question is that if i use SHA512 algo. to encrypt my value then how can i decrypt it? I mean is there any algo. for decrypt my value ?????
regards,
krishnraj
Rana k.j.
|
|
|
|
|
Don't use SHA512. SHA512 is a ONE WAY HASH algo, meaning that you can't "decrypt" it. You have to use an ENCRYPTION algo such as Triple DES or AES.
|
|
|
|
|
I have two reports, both are designed on same patern. But the problem is when we try to view the frist report its working fine and fetching the data based on conditions, where as other report is fetching the whole data from the database. I tried checking he SQL query in the mssql interface and the its returning the data according to the conditions, when i try to use same query in the cristal report in vb.net, its not returning the desired result.
I have attached the database schema and source code in the following location.
http://www.ourongoingprojects.com/sat/ReportProb.zip[^]
Sathyendra Vemulapalli
modified on Monday, March 31, 2008 3:16 AM
|
|
|
|
|
When I do a database insert there are no errors displayed, but when I check the database the data does not insert into the database.
Why?
Here is my code. I declared addRow globally.
addRow = lpDataSet.Tables("tbl_students").NewRow()
addRow("stud_cell") = txtStudCell.Text
addRow("stud_phone") = txtStudPhone.Text
lpDataSet.Tables("tbl_students").Rows.Add(addRow)
Try
studTableAdapter.Update(addRow)
Catch err As Exception
MessageBox.Show(err.Message)
End Try
|
|
|
|
|
Try this code
addRow = lpDataSet.Tables("tbl_students").NewRow() <br />
addRow("stud_cell") = txtStudCell.Text <br />
addRow("stud_phone") = txtStudPhone.Text <br />
lpDataSet.Tables("tbl_students").Rows.Add(addRow) <br />
<br />
Try <br />
studTableAdapter.Update() <br />
Catch err As Exception <br />
MessageBox.Show(err.Message) <br />
End Try
|
|
|
|
|
When I take the dataRow variable out of the table adapter update function I get the blue line.
The error says the following.
Overload resolution failed because no accesdsible update accepts this number of arguments.
Why wont the update update or add a row to the database with or without the dataRow variable as an argument?
|
|
|
|
|
Oops Sorry
addRow = lpDataSet.Tables("tbl_students").NewRow()
addRow("stud_cell") = txtStudCell.Text
addRow("stud_phone") = txtStudPhone.Text
lpDataSet.Tables("tbl_students").Rows.Add(addRow)
Try
studTableAdapter.Update(lpDataSet, "tbl_students" )
Catch err As Exception
MessageBox.Show(err.Message)
End Try
|
|
|
|
|
You can't put the name of a dataset coma the name of a table.
|
|
|
|
|
Maybe it needs AcceptChanges method for that table.
Sourie
|
|
|
|
|
I've spent most of the afternoon searching and looking at all kinds of encryption classes. I know that encryption can be a very detailed topic and it should be, but I'm just looking for something simple.
I want to take a text string 'The cat ate the mouse' and convert it to a SHA2 hex string that I can then store into a database.
Is there code to simply just do this? I've downloaded all kind of samples which have classes involved that are several pages of code. It's got to be simpler than this? Or of course then it might not be secure if it is too simple to encrypt / decrypt.
Any suggestions on something simple would be helpful?
Lost in the vast sea of .NET
|
|
|
|
|
You can use a function like the following:
Public Shared Function EncryptSHA512(ByVal strAs String) As String
Dim Bytes() As Byte
Dim Encoder As New System.Text.UTF8Encoding
Dim SHA512 As New System.Security.Cryptography.SHA512Managed
Dim SHA512String As String
Bytes = Encoder.GetBytes(str)
Bytes = SHA512.ComputeHash(Bytes)
SHA512String = Convert.ToBase64String(Bytes)
Return SHA512String
End Function
Alexei Rodriguez
|
|
|
|
|
This function is exactly what I was looking for. Currently I'm writing a test application that simply has a form and two buttons, encrypt and decrypt. The encrypt works great with this function, but when I try to write the decrypt function everything works, but I can't find logic to reverse the ComputeHash code?
Below is what I have:
Public Shared Function DecryptSHA512(ByVal str As String) As String<br />
Dim Bytes() As Byte<br />
Dim Encoder As New System.Text.UTF8Encoding<br />
Dim SHA512 As New System.Security.Cryptography.SHA512Managed<br />
Dim RegularString As String<br />
Bytes = Convert.FromBase64String(str)<br />
'Bytes = SHA512.??(Bytes) 'Can't find reverse logic<br />
RegularString = Encoder.GetString(Bytes)<br />
Return RegularString<br />
End Function
Thanks again for the code you have given and any suggestions on the decrypt logic is welcome
Lost in the vast sea of .NET
|
|
|
|
|
This can not be decrypted
Its a one way hashing algorithm
Alexei Rodriguez
|
|
|
|
|
SHA is not an encryption algorithm, it's a hashing algorithm.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
I have 2 phone number fields in the database that right now are a text dataType. They were an int, then I changed them to varchar(13). When I try to do an insert into the database there is an exception that says the following.
Failed to convert paramater value from a string to an Integer.
Here is my code. I declared addRow globally.
addRow = lpDataSet.Tables("tbl_students").NewRow()
addRow("stud_cell") = txtStudCell.Text
addRow("stud_phone") = txtStudPhone.Text
lpDataSet.Tables("tbl_students").Rows.Add(addRow)
Try
studTableAdapter.Update(addRow)
Catch err As Exception
MessageBox.Show(err.Message)
End Try
|
|
|
|
|
AAGTHosting wrote: Try studTableAdapter.Update(addRow)
Me thinks you didn't update the DataSet to change the datatype of the phone number field.
|
|
|
|
|
I checked the dataSet and it says the phone number field is text. Also, when I try to do an insert the info does not get inserted into the database.
|
|
|
|
|
AAGTHosting wrote: I checked the dataSet and it says the phone number field is text.
Well, the code is throwing an exception that says otherwise. After changing the field type in the database, did you do ANYTHING to update the schema of the dataset?? If not, then it's not updated and it's still using an Integer type for one of those fields.
|
|
|
|
|
I did update the schema of the dataset. In fact, when I tried to change the dataType in the designer it was already text.
|
|
|
|
|
I have a form which in effect is a launch pad for other forms.
When an option is clicked by the user, I wish to open a form associated with the option.
The problem I have, is that the opened form should remain on top of the main form, like an mdi child would remain on top of an mdi parent.
To achieve this, I have tried setting the TopMost property and the TopLevel property of the child form, which seemed to work until I drag a other application over my app, then the application will appear between the my parent form and my child form.
By the way, my parent form is NOT an MDI parent.
Any help on resolving this would be gratefully received.
Steve Jowett
-------------------------
It is offen dangerous to try and see someone else's point of view, without proper training. Douglas Adams (Mostly Harmless)
|
|
|
|
|
Steven J Jowett wrote: like an mdi child would remain on top of an mdi parent.
An MDIChild form doesn't sit on top of an MDIParent. It's rendered inside an MDIClient control on the MDIParent form.
The TopMost property sets the form as the TopMost form system-wide, not application-wide.
You need the call the Show(IWin32Window) method of your second form to make it a application "TopMost" window. Something like this:
Dim newForm As New Form2()
newForm.Show(Me)
|
|
|
|
|
Thanks for the quick reply and solution
Best regards
Steve Jowett
-------------------------
It is offen dangerous to try and see someone else's point of view, without proper training. Douglas Adams (Mostly Harmless)
|
|
|
|
|
Dear Frnd
I have one form with name is FrmInvoice.
On that form, i have InvoiceId- Primary Key (AutoGenerate) and Other is InvoiceNo-(which is manual entry)
I want to checked that the Value in InvoiceNo is must enter unique, i try so many things but i was unable.
So please tell me how i control this.
Please reply on that email address: sikhan555@yahoo.com
Regards,
sikhan
|
|
|
|
|
sikhan555 wrote: I want to checked that the Value in InvoiceNo is must enter unique, i try so many things but i was unable.
Did you try to simply lookup the entered Invoice number in the database and see what it returned??
|
|
|
|
|
I was used the data reader for checking the duplicate record, I want to check the InvoiceNo (Format is Inv/001/2008) is not duplicating in the database. I am already asign primary key to InvoiceId.
Please tell me what i do for checking the duplicate record.
Thanks in advance.
sikhan
|
|
|
|