|
It's absolutely amazing what you can get out of Google[^] if you just try.
|
|
|
|
|
Hi!
Is there a flexgrid conrol in vb.net as in vb?if it is not,what should i do to get the same functinality.
Regards
Roshan
|
|
|
|
|
de silva wrote: Is there a flexgrid conrol in vb.net as in vb?if it is not,what should i do to get the same functinality.
Try the DataGridView. It is similar functionality once you have got your head round how to use it.
David Loring
!! Keep Music Live !!
|
|
|
|
|
Can we insert data into the DataGrid without connecting it to a table in the database?(selecting a row/column/cell)
Roshan
|
|
|
|
|
Yes absolutely. It does not have to be connected at all. The only thing I found difficult was getting my head round the way you go about doing this. You can also have columns with combo box drop downs or check boxes.
I could try an help you out if you get stuck with some examples, but I don't guarantee that I am doing it the right way! I have worked it out over a period of time, and it works for me.
I am away from my email at present so do not be surprised if there is a delay in replying.
David Loring
!! Keep Music Live !!
|
|
|
|
|
Hi,
Can anyone tell me if VB .NET leaves strange entries in My Documents\%USER PROFILE%\Application Data when an item is deleted from a project?
CGlobalParameters.dll_Url_4l0fzug125s0wj3wm2qsvdo53iyv2xj5 is the name of a folder that has been created. I did delete the CGlobalParameters.dll from a project. There are several others that all appear to be items or projects I have deleted, but Spyware Detector is saying they are spyware.
David Loring
!! Keep Music Live !!
|
|
|
|
|
Not when a project is deleted, no. It's possible that some stuff gets in there when the code is run though, like settings files or minidumps.
|
|
|
|
|
Thanks Dave
Maybe they get there when VS2005 crashes, as it has done several times, but they just appear to contain a configuration file the contents o which is:
<configuration>
<configsections>
They are all itentical.
David Loring
!! Keep Music Live !!
|
|
|
|
|
HI , I want one function to be called repltedly after a perticular interval. SO i have implemented OnTimedEvent. In that I called my function IsFinish. Isfinish contains some more function calls.
If i call Isfinish from a button and get the values after some interval it is workig fine. but if I call this function from OnTimedEvent it is returning null. Please guide.
ciacia
|
|
|
|
|
There's no such event in the .NET Framework. Which Timer did you use? There are three in the .NET BCL:
System.Threading.Timer
System.Timers.Timer
System.Windows.Forms.Timer
|
|
|
|
|
i have implemented Imports System.Timers and on form load
AddHandler NotifyTimer.Elapsed, AddressOf OnTimedEvent
please tell me some other way
|
|
|
|
|
The System.Timers.Timer uses a seperate thread to call the timer elapsed handler code. If your code is trying to get data from user controls to do it's work, it won't get any data. This is because you can only use a controls methods and properties on the thread that the control was created on.
Let's see your OnTimedEvent method...
|
|
|
|
|
can you tell me the solution for my problem?
|
|
|
|
|
Please allow me to repeat myself:
Let's see your OnTimedEvent method code.
|
|
|
|
|
Private Sub OnTimedEvent(ByVal source As Object, ByVal e As ElapsedEventArgs)
IsFinished()
End Sub
Function IsFinished() As Boolean
Dim strLength As String
strLength = New String("255")
Dim strPosition As String
Dim IntLentgh As Integer
Dim IntPosition As Integer
strPosition = New String("255")
mciSendString("status track length", strLength, 255, 0)
mciSendString("status track position", strPosition, 255, 0)
IntLentgh = CInt(strLength)
IntPosition = CInt(strPosition)
If IntPosition >= IntLentgh Then
notifyTimer.Stop()
MsgBox(strPosition)
MsgBox(strLength)
End If
End Function
|
|
|
|
|
You're making a mistake with these strings ("255"). You're not creating an empty string 255 characters wide. YOu're making a string 3 characters wide, containging "255". Then in your mciSendString call, you're passing this string in parameters2, but in parameter 3, you're telling mciSendString that the string buffer you just passed in was 255 characters long. No, it's not, it's 3 characters long!
I think you're looking for this:
Dim strBuffer As New StringBuilder(255)
On top of that, you're completely ignoring the return value comming back from the call to mciSendString. You REALLY need to pay attention to that value:
Dim rc As Integer
rc = mciSendString("status track length", strBuffer, 255, Nothing)
If rc > 0 Then
' An error occured!
End If
|
|
|
|
|
OHHH, thaks a lot for your suggestion. I tried stringBuilder but it is not recognizing it I have also imported system.text.stringbuilder .
|
|
|
|
|
No, you Import System.Text, not System.Text.StringBuilder.
|
|
|
|
|
Hello,
I am creating an application using vb and SQL 2005.
I have a table of users, that contain there usernames and passwords. When a new user is added it stores all the passwords in clear text in the database.
What is the best method to use to be able to crypt the passwords in the database.
Also, when the user login, i have a sql statement that will compare the username and password that they enter in the login dialog box, to what is in the database. If the password is encryted, would I still be able to compare their password to see if they can still login.
i.e.
<br />
"Select * From Users Where LoginID=@LoginID And Password=@Password"<br />
Many thanks for any suggestions,
Steve
|
|
|
|
|
|
Hi Steve
You could use the SQL-Server HashBytes function with the SHA1 algorithm to store a hash of the concatenated user-id and password strings. Your code for authenticating a user would then be:
select * from Users
where LoginID = @LoginID
and HashedPassword = HashBytes('SHA1', @LoginID + @Password) The reason for not hashing just the password is that some-one with database access should not be able to see that two people have the same password - adding the user Id ensures that the hash value would be different.
Regards
Andy
|
|
|
|
|
MD5 is proven weak.
A better method would be to salt the password, encrypt it with your favorite (stronger) algorithm to get a hash of the salted password, then store the hash and the salt in the database.
When you go to check the users password, retrieve the password hash AND the salt, salt the entered password, run it through the same encryption algorithm you used to encrypt the original password to get it's hash, then compare to the two hashes.
There's examples of this all over the web. Just Google for "VB.NET password salt encrypt database". I highly recommend reading this[^] article on CP too.
|
|
|
|
|
Make sure you turn case sensitivity on for the columns you are encrypting. I had a nasty little bug once because of that.
Ben
|
|
|
|
|
Hi Everyone:
Cleako showed me a link where I can return records that were either added to or modified in a DataSet.
What I would like to do is show the user a message giving them the number of records that where added to the dataset and a number of existing records that where modified before they commit update to the database.
I didn't see anything like - MyDataSet.GetChanges(DataRowState.Modified.Count) or MyDataSet.GetChanges(DataRowState.Added.Count) which would make sense but isn't in the DataRowState class.
Anyone have an idea on how to accomplish this?
Thanks,
Quecumber256
|
|
|
|
|
The answer is staring you in the face. What does DataSet.GetChanges() return?? Another DataSet object! A DataSet is a collection of DataTables, which is a collection of DataRow objects. You can get the number of tables in this new DataSet quite easily:
Dim changes As DataSet = MyDataSet.GetChanges(DataRowState.Modified)
If changes IsNot Nothing AndAlso Not changes.HasErrors Then
' Get the number of tables in this changed dataset.
Dim numTablesChanged As Integer = changes.Tables.Count
' Enumerate through these tables and add up the number of rows in each.
Dim numTotalRecordChanges As Integer
For Each t As DataTable In changes.Tables
numTotalRecordChanges += t.Rows.Count
Next
End If
|
|
|
|