Jump to content
Xtreme .Net Talk

PlausiblyDamp

Administrators
  • Posts

    7016
  • Joined

  • Last visited

Everything posted by PlausiblyDamp

  1. In the code snippet Default Public ReadOnly Property Item(ByVal index As Int32) As Employee Get < ******Stuck here******** Return CType(Me.Item(index), Employee) < ***** AND HERE you are calling the function Item(Int32) from within itself, hence the reason it is just recursing... You probably want to return the contents of innerlist like Default Public ReadOnly Property Item(ByVal index As Int32) As Employee Get < ******Stuck here******** Return CType(Me.InnerList(index), Employee) < ***** AND HERE
  2. VS .Net 2003 will not work with the 2.0 framework - you will need either VS 2005 or use the command line tools supplied by the SDK.
  3. That's what namespaces are there for - to seperate classes into logical groups. If you need to access a class from a particular namespace then you will either have to refer to the class using it's namespace or import the namespace at the top of the code file.
  4. You would need to prefix Catalog with it's namespace, however you seem to be putting it into the already existing System.dat.sqlclient namespace - is there a reason for this, usually you would want to extend the system provided namespaces in this manor.
  5. Are you planning on modifying existing functionality or just adding new functionality to the web service? If you are adding functionality but leaving the existing methods alone then existing clients will continue to work just fine. If you are modifying functionality then things can get tricky - one way is to overload the WebMethod and use the MessageName parameter to the WebMethod attribute to specify different names in the wsdl.
  6. Not tested it but try something like the following Dim lines As String Dim sounds() As String Dim mySoundsr As String = Application.StartupPath & "\save.ini" Dim srr As StreamReader Try If File.Exists(mySoundsr) Then srr = New StreamReader(mySoundsr) lines = srr.ReadToEnd sounds = lines.Split(Environment.NewLine) Else MessageBox.Show("File not found") End If Catch ex As Exception MessageBox.Show("Error reading file: " & ex.Message) Finally If Not srr Is Nothing Then srr.Close() End If End Try
  7. The basics idea is not that difficult - if the framework is not installed already then install it. As to the renaming of Text1 to TextBox1 that only matters if you never changed the controls from the default names...
  8. Are you getting any errors when trying to read or is it just failing to populate the array? If you step through the code in the debugger is there a particular line where it starts to do unexpected things?
  9. C# uses the return keyword
  10. What do you mean by Are you getting an overflow when you use the code I posted? How is the underlying table column defined (datetime, smalldatetime etc)? You shouldn't need to be formatting the date as a string when using parameters - that is one of the main reasons for using parameters.
  11. Can you step through the web service code in a debugger? If so see where it fails as a 500 error is a bit vague as to the problem itself. Also, just out of curiosity more than anything, is there a reason why WSDL isn't an option?
  12. Exceptions as a rule do not have associated error codes - the exception type denotes the error condition itself. Certain exception derived classes may expose an error number that is specific to the exception type i.e. SQLException exposes the underlying SQL error number. Is there a reason why you feel you need to associate a number with a particular error?
  13. Dim Parm3 As SqlParameter = .SelectCommand.Parameters.Add("@movedate", SqlDbType.DateTime)
  14. user.Identity.Name
  15. Parm3.Value = movedate If you are using parameters you don't need to worry about the formatting.
  16. public class Class1 { [DllImport("user32.dll", EntryPoint="SystemParametersInfo", SetLastError = true)] public static extern bool SystemParametersInfo(uint action, uint param, ref int vparam, uint init); const int SPI_GETSCREENSAVERRUNNING = 0x0072; public static bool IsSaverRunning() { int IsRunning = 0; SystemParametersInfo(SPI_GETSCREENSAVERRUNNING,0,ref IsRunning,0); if (IsRunning==0) return false; else return true; } } } this can be called from a standard windows timer or similar like if (Class1.IsSaverRunning()) { //Handle saver running here } Should work on all versions of windows from 98 / win2K - will not work on 95 or NT4
  17. Try the following for a declaration Public Declare Function xyz_function Lib "xyz.dll" (ByVal x As Short, ByVal y As Short, ByRef refArray() As Byte) As Short and see if using a method body of Dim refData(31) As Byte If xyz_function(CShort(0), CShort(2), refData) = 0 Then ... End If works
  18. Look at the classes under System.Net - WebClient for one will happily work with SSL
  19. Trust me you will encounter problems sooner or later due to the formatting of the date using this method - a stored procedure or a parameterised query will be much less error prone.
  20. Are you calling into any COM components as part of the non-UI code? IIRC .Net 1.0 had 'issues' with the COM threading model, these were fixed in 1.1
  21. You cannot just use .Net variable inside an SQL command like that, you would be much better off looking at using either a parameterised query or a stored procedure that accepts parameters; search these forums for examples of both ways - they crop up a lot in questions here. Also if you are connection to a SQL server you might want to use the classes under the SqlClient namespace rather than OLEDB as then you will not be going through the OleDb layer but will be using .Net's native sql support.
  22. Check you have spelt all table and column names correctly - failure to do so often results in this error when using access.
  23. You will get the thread aborted exception if there is any code following your Response.Redirect, if you search these forums you should find further information on this problem.
  24. VS 2003 will happily support oledb connections without the need to go to ADO.
  25. How long is exactly? One thing you might want to do to speed things up is look at using a HashTable rather than a collection. Also is there a reason why you have declared just about every single data type as object rather than the actual data type of the values you want to store?
×
×
  • Create New...