Jump to content
Xtreme .Net Talk

PlausiblyDamp

Administrators
  • Posts

    7016
  • Joined

  • Last visited

Everything posted by PlausiblyDamp

  1. Will have a better look at it later today - but as a quick one is the mscomm control required for the server as I can't see any code that refers to a serial port in there. Quick update: In your server try using ' Return the data received from the client to the console. Dim ClientData As String ClientData = Encoding.ASCII.GetString(Encoding.ASCII.Convert(Encoding.Unicode, Encoding.ASCII, bytes)) in place of your existing ' Return the data received from the client to the console. Dim ClientData As String = Encoding.ASCII.GetString(bytes)
  2. Not sure if it's a typo in entering it here but you have a . between the '730' and '430' rather than a comma.
  3. you would need to cast sender to a picturebox. ((PictureBox) sender).BackColor = Color.Blue; should do the trick.
  4. My bad - I just realised the tables are structured the other way round. You will probably find a better solution involves creating a third table (something like EmployeePrivilages) which ties the other two tables together. e.g. have two columns EmployeeID and PrivilageID both of which are Foreign key relationships. That way there is no direct requirement for an employee to be modified if a privilege is deleted. Plus you then get the flexibility of allowing multiple privileges per employee if required.
  5. In your code you have the lines ' Translate the passed message into ASCII and store it as a Byte array. Dim data() As Byte = System.Text.Encoding.Unicode.GetBytes(Message) did you mean to use Unicode there? Would it be posible to attach the code for the client and server its (or a simple stripped down version of them)?
  6. Not got 2.0 installed on this PC so I can't test it but have you tried placing a literal on your page and assigning tw.ToString() to it's text property rather than using Response.Write?
  7. If the AdminPrivilages table is effectively a child relationship to the Employees table then you can delete entries from it without having to worry about the Employees table. If you simply flag a permision as no longer being valid you would also need to code in a system in which every time you assign a new permision you will need to check if it already exists and re-enable it if it does exist or create a new entry if it doesn't - failure to do this will result in lots and lots of redundant entries in the AdminPrivilages table.
  8. Not sure what you mean by if you meant the same .bas file was shared between all applications then this can still be acheived - when you add an existing item to your project you can click on the drop down next to the open button and select link instead. If you are reusing the code a lot you may want to investigate creating a classlibrary as a means to share the compiled code.
  9. http://www.xtremedotnettalk.com/showthread.php?t=83092 may be worth a quick read.
  10. Is there any chance you could post an example of the contents of sWhereClause in each example - without knowing the underlying data types etc. it is quite tricky to diagnose the problem. Also rather than relying on string concatenation you may want to consider a parameterised query (search these forums for several threads on the topic) - this will result in cleaner code and also remove the posibility of security exploits like injections.
  11. IIRC you need to set the credentials for the proxy rather than the WebClient.
  12. Collections are one of the more common uses of generics - how ever they can be used for any generic ;) code. Also generics are a compile time thing - the compiler itself will prevent you using incorrect data types, the errors will be caught at compile time rather than run-time.
  13. Is the control one written in house or developed by a third party? Also is the control a .Net control or an ActiveX control you are using under .Net? If it is a 3rd party control try re-installing it and see if that fixes the problem - if an inhouse control check there haven't been any breaking changes made to it recently.
  14. IIRC OleDbCommand doesn't support named parameters - just use ? in place of the names. clicky for another thread on the topic
  15. http://www.thefreecountry.com/webmaster/loganalyzers.shtml
  16. You don't have two variables called ASSEM_NUM do you? Again I would recomend trying to remove the global though - could the printing routine not be modified to accept a parameter rather than rely on the global?
  17. Not entirely sure what you are trying to do here. What are each of the forms for in the above code? Also I notice you create a new instance of Form2 from within Form2 and never use it while also assigning 2 new instances of Form1 to firstform. If you just want to display a picture in a picturebox you could put the line Me.PictureBox1.Image = New Bitmap("C:\MyImage.bmp") into the Form's load event and it should display correctly.
  18. When doing this the .Join method returns the delimited string. Try something like Dim AllRoles2 As String AllRoles2 = String.Join("|", Roles.ToArray(GetType(String)))
  19. Although you can't assign a method that requires a parameter to a thread you can create an object that accepts either parameters for it's constructor or exposes them as properties and pass a method of the class to the thread constructor.
  20. If you run the following against Northwind you should see what I mean. INSERT Employees (FirstName, LastName) VALUES ('test', 'Test') SELECT @@IDENTITY
  21. In simple terms reusing numbers can cause problems - SQL has no way of knowing if there is a meaning attached to the number (lookup to another table, join etc) and by always using new numbers prevents and problems or confusion caused by reusing existing numbers. SQL doesn't just pick the MAX(ID) + 1 as the next number as this would cause issues with concurrent pending transactions - each one would need a unique number. In fact inserts that fail (constraint violations, rollback etc) will cause numbers to be skipped in the sequence as a consequence.
  22. Not if you use the SmtpMail class.
  23. http://www.xtremedotnettalk.com/showthread.php?t=92116
  24. After doing an insert you can always get the value from @@IDENTITY
  25. You would also need to consider if the number is used in any relationships - if so what happens if a number is re-used? How would you handle two simultaneous inserts? Two inserts and one is rolled back? Unless you have a desparate need to keep them sequential I wouldn't worry about it.
×
×
  • Create New...