Jump to content
Xtreme .Net Talk

PlausiblyDamp

Administrators
  • Posts

    7016
  • Joined

  • Last visited

Everything posted by PlausiblyDamp

  1. Is there no other information displayed other than the exception type?
  2. What database are you using? If it is SQL then you are much better trying to catch a SqlException - this will allow you to check the SQL error code. If you are using access then check for a OleDbException this at least gives you an ErrorCode property.
  3. http://www.xtremedotnettalk.com/showthread.php?t=70273&highlight=keycodev2
  4. Maybe something like a typical windows wizard? If so have a look here
  5. What errors do you get? what does the contents of strCommand look like?
  6. Storing usernames in the DB is ok, storing passwords is generally a bad idea - it is much better to hash the password and store the hash value. When somebody logs on you hash the password they enter and compare this with the hashed value in the DB. This way no plaintext passwords are stored and neither are the hashes reversible (i.e. you can't get a password back from a hash). If you are going to be authenticating users etc you probably want to look at Forms Authentication in .Net - it takes care of quite a bit of the hard work (like cookies etc)
  7. You do not have to worry about it as much as with access. If you do wish to reclaim free space you can issue the command DBCC SHRINKDATABASE e.g. dbcc shrinkdatabase (databasename,10) will shrink the database but leave 10% of the new file size as free space. This isn't always going to reclaim all the free space but it is quick. Unlike access this can be executed while users are still accessing the database.
  8. In a nutshell yes. You can enable cookieless session from web.config but this comes with it's own set of problems.
  9. You really need all 160 columns in the table? I'd rule a datagrid out for starters - displaying multiple rows of 160 columns is going to create one hugh html page....
  10. you could always search for " FROM " - note the space either side. Also is there a reason you are trying to parse out an SQL string - there may be an alternative solution
  11. Page_Unload will be the last event to fire.
  12. wait is the name of a form in his application - you will need to create a form of your own and use it in place of wait.
  13. Have you set the Form's KeyPreview property to true?
  14. Jpeg images will alway suffer some compression when saving - they are a 'lossy' format. Even if you say try to save with no compression there will always be some loss in quality / file size. You may be better of looking at something like .png as a file format as this does allow images to be saved with no loss of information.
  15. http://www.xtremedotnettalk.com/showthread.php?t=80945 http://www.xtremedotnettalk.com/showthread.php?t=79732
  16. Whoops - my bad, bit of a typo (i'll fix it now) http://www.xtremedotnettalk.com/showthread.php?t=73612&highlight=impersonation is probably a good link to start. If you need to change permissions on a database either use Enterprise Manager to create a login / user for the DB or through Query Analyzer you can use a couple of stored procs (sp_grantlogin and sp_adduser)
  17. I notice you aren't setting the parameters to a value inside the procedure - that's why they are returning as null. You would need to do something like (may be a much better way to this though) CREATE procedure dbo.Appt_Login_NET ( @LoginName nvarchar(15), @Password NvarChar(15), @UserName nvarchar(15)Output, @UserPassword nvarchar(15)Output, @UserClinic nvarchar(3)Output, @UserTester bit Output ) as select UserName, UserPassword, UserClinic, UserTester from Clinic_users where UserName = @LoginName and UserPassword = @Password set @UserName = (Select USerName from clinic_users where UserName = @LoginName and UserPassword = @Password set @UserName = (Select UserPAssword from clinic_users where UserName = @LoginName and UserPassword = @Password but that is pretty inefficient - is there a reason you are using output parameters in this way? Couldn't you just check the values in the results the stored proc returns? Or even check the rowcount to see if any rows where returned? Possibly use a datareader. i.e. modify the end of your code to look like con.Open() dim dr as SQlDataReader dr = cmd.ExecuteReader() if dr.read Label1.Text = dr(0) Else Label1.Text = "No Results Found" End If con.Close()
  18. The line highlighted needs to be executed from within a Method (function or sub) you cannot just execute code directly at the class level like that.
  19. Have you checked the Rootnamespac for your application is correct? Is the image's buld option set as an embedded resource> http://www.xtremedotnettalk.com/showthread.php?t=83574 may be of some help
  20. The only way you will get the e-mail address of a user is to ask them for it and hope they enter the correct one. There isn't really the concept of a smtp address being associated with a computer - they are associated with individuals and anybody can have multiple e-mails if they desire.
  21. If you are accessing SQL from an ASP.Net application the web app will access the DB as the user account the application itself runs as (\ASPNET. You will either need to grant this account permissions to the SQL server / database or investigate impersonation (search these forums and you will get some examples)
  22. Without knowing exactly what the code in question does it is hard to justify the use of enums there. Generally enums are a nice clean way of implementing constants in your code, rather than having arbitrary numbers an enum becomes a collection of related constants. These can be passed as parameters or used as properties and the IDE will prompt you with the range of values available while the compiler will prevent values being used which are not part of the enumeration. As an example try typing in the MessageBox.Show command and as you enter parameters notice how it presents a list of options for things like buttons, icon to dispaly etc.
  23. Private Sub Form1_MouseMove(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles MyBase.MouseMove Static lastX, lastY As Integer If e.X > lastX Then 'moved to right 'difference is e.x-lastx label1.text = e.X - lastX End If 'etc lastX = e.X lastY = e.Y End Sub as a starter should ge tyou going.
  24. Could you give a little more detail please, what kind of e-mail function for a start.
  25. Easiest way is create a class that has 3 properties (e.g. Name, Score, Status) and store instances of the class in the ArrayList. Public class Test 'These really should be properties rather than public vars public Name as string public Score as integer public Pass as boolean End Class 'Elsewhere you could now do code like Dim a as new ArrayList Dim i as new Test i.Name = "John" i.Score=30 i.Pass=true a.Add(i) 'etc. 'to get to an item use i=a(0) if you need to refer to items in the arraylist it would be a(0). You may also find one of the other collection classes useful such as a HashTable - the following is an updated version of the above code... Public class Test 'These really should be properties rather than public vars public Name as string public Score as integer public Pass as boolean End Class 'Elsewhere you could now do code like Dim h as new HashTable Dim i as new Test i.Name = "John" i.Score=30 i.Pass=true h.Add(i.Name, i) 'etc. 'to get to an item use i=h("John") 'or i=h(0)
×
×
  • Create New...