Jump to content
Xtreme .Net Talk

PlausiblyDamp

Administrators
  • Posts

    7016
  • Joined

  • Last visited

Everything posted by PlausiblyDamp

  1. Try using a System.Threading.timer instead Protected Overrides Sub OnStart(ByVal args() As String) ' Add code here to start your service. This method should set things ' in motion so your service can do its work. Dim t As New System.Threading.Timer(AddressOf TestCallback, Nothing, 0, 1000) End Sub Private Sub TestCallback(ByVal state As Object) End Sub
  2. What do you mean by , is it raising errors or just not deleting the records?
  3. http://www.pinvoke.net/default.aspx/netapi32/NetShareAdd.html is probably a good starting point.
  4. If you are running taskmanager and then start the app does it appear in the task list?
  5. You can always use the UPDATE keyword IF UPDATE() BEGIN --handle updated field here END Also http://www.databasejournal.com/features/mssql/article.php/1479821 contains a decent article on COLUMNS_UPDATED in case that is how you decide to handle it.
  6. Does it give any errors? What is the SQL doing?
  7. If you go through the properties dialog and create your settings there then you can access them, see the attached sample for an example.WindowsApplication1.zip
  8. Under .Net either remoting or web services are the easist ways to go.
  9. http://www.xtremedotnettalk.com/showpost.php?p=452128&postcount=3
  10. If you are displaying them with the .ShowDialog Method simplyset a button on the form to be the cancel button and it will close automatically when escape is hit.
  11. What OS are you running? 2003 server has this functionality built in and would handle it far smoother than getting your own app to do so.
  12. What error (if any) does it give?
  13. http://www.xtremedotnettalk.com/showthread.php?t=83092
  14. You may want to investigate SSIS (Sql Server Integration Services), the SQL 2005 update to DTS, as this gives far more control and functionality.
  15. If you enter a name for the setting in the first column, data type in the second and scope in the third then it will generate a settings object for you that can be accessed under the Properties namespace of your application.
  16. Probably because it isn't an access database, it is probably a SQL Express database. Try using the SQLCLient.Connection to connect instead.
  17. Makes you wonder why they didn't add a Something keyword to simplify the syntax... If Me Is Something Then Save(Medium.GetKey) End If
  18. What do you mean by not supported? If you are getting errors about the System.Drawing namespace you simply need to add a reference to the System.Drawing.Dll.
  19. Perhaps it would help if you did give a bit more information. What do you mean by ? If you are ploting some kind of graph what kind of graph, if you are simpy receiving a series of x / y co-ordinates then a triangle / triangle strip is probably the easiest solution.
  20. DTS is a pretty good tool for doing this kind of thing and would definately allow you to do the import / run stored proc kind of thing. If you have SQL 2005 it contains a replacement for DTS Sql Server Integration Services (SSIS) which is a big improvement over DTS and gives much better handling of errors etc.
  21. If your budget stretches to it SQL or Oracle may be a better choice than Access. Alternatively MSDE, SQL Express or MySQL might all be valid options. If you could give us a bit more detail about the type / amount of data then you might be able to get a more specific answer.
  22. Suit yourself - basic rules (as listed above). One active reader per connection. Close reader when finished with. Close connection when finished with.
  23. There have been well documented problems with how poorly Wndows 9x stores the passwords - several tools are freely available to recover them. Xp / 2000 manage this a whole lot better though. If you are using the encryption classes provided by .Net the code is fairly simple and the resultant data should be encrypted sufficiently well. http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dncapi/html/encryptdecrypt2a.asp is a pretty good article on what is required and also looks at the idea of using an X.509 certificate to encrypt the data - this can reduce the weakness in how the key itself is stored.
  24. Just a few points to make: Firstly I would strongly recomend against using string concatenation to build SQL statements - they are error prone and can lead to major security holes. Either use stored procedures, or failing that at least use parameterised queries as they are a big improvement over pure stings. Secondly I find the logic in If Cnn.State = ConnectionState.Open Then Cnn.Close() Cnn.Open() End If Dim Cmd As New SqlCommand(SQL, Cnn) Dim DR As SqlDataReader = Cmd.ExecuteReader If StartReader = True Then DR.Read() Return DR a bit odd in how it closes the connection if it is already open. I personally would open the connection if it wasn't open or just leave it open if it was already open, but close it when I have finished using it rather than leaving it open and then closing and re-opening it when I need it again. Be aware that only a single datareader can be active on a connection at a time, when the reader is finished close it. I also fail to see the benefit of the StartReader parameter as in every situation I've used a reader the logic has been While dr.Read() 'do stuff with dr End While dr.Close() forcing the reader to advance a single record first seems a fairly odd idea, one likely to cause the first record to be skipped or not depending on the parameter. Thirdly I would also consider a more obvious naming convention, SetCnn could just as easily be SetConnection which is far more readable and less likely to cause confusion down the line. Also the name of the GetDA method is not giving the true story, admittedly it does indeed return a DataAdapter; it also trashes the DataSet you pass in as a second parameter replacing it with a brand new one called "X" and populates it with the results of executing the cmd parameter Fourthly some of the methods seem a bit redundant; do SetCnn and GetCmd really simplify the code anymore than just simply creating the command and connection objects directly? You might find some of the information onhttp://msdn.microsoft.com/practices/Topics/patterns/default.aspx?pull=/library/en-us/dnpatterns/html/dp.asp and http://www.microsoft.com/downloads/details.aspx?FamilyId=F63D1F0A-9877-4A7B-88EC-0426B48DF275&displaylang=en worth looking at as these discuss and give decent examples of DataAccess components.
  25. Can't think of an easy way of doing this through .Net - if you are any good with C then the following link does include some sample c source for doing this, will be a difficult job to convert all the declarations to .Net though.
×
×
  • Create New...