Jump to content
Xtreme .Net Talk

kejpa

Avatar/Signature
  • Posts

    321
  • Joined

  • Last visited

Everything posted by kejpa

  1. Hi, after a look at it I think it's covering .NET 1.1 and I'm in 2.0 :( I guess the easiest way is to parse the app.config file Best regards /Kejpa
  2. Hi, Have you tried outer join? /Kejpa
  3. Hi all, problem solved. It's using properties that caused the problem, changing it to a function and a sub solved it halfways, returning only strings and numbers made the rest work. My "middleman" now looks like this Public Interface iMyProperties Inherits IDictionary(Of String, IProperty) End Interface Public Interface IProperty Function Properties() As Specialized.ListDictionary Sub [Property](value As DictionaryEntry) End Interface /Kejpa
  4. Hi, I have some troubles with my remote objects. My "middleman" looks like this Public Interface iMyProperties Inherits IDictionary(Of String, IProperty) End Interface Public Interface IProperty ReadOnly Property Properties() As Specialized.ListDictionary WriteOnly Property [Property]() As DictionaryEntry End Interface In the server I have a class marshaled that implements iMyProperties, one of my classes contains numeric only ListDictionary that implements IProperty.Properties and receiving it in the client as a ListDictionary is no problem. Another class has Strings in the ListDictionary and if I have more than one item there I get a SerializationException, one item is no problem :confused: Can anyone please help me? /Kejpa
  5. Hi, I have managed to get a hold of the remote object in the client app by using the following code oRemoteRandomServer = CType(Activator.GetObject(GetType(iMyTest), "tcp://localhost:6100/RandomServer.rem"), iMyTest) But I don't like the idea of hard coding the computer name and port#, the best approach would be to get the settings from app.config Any help appreciated /Kejpa
  6. Hi, First of all I have to say.... You should use parameters, make things a lot easier If you still want to create a string there shall be no quotes around the NULL keyword... Update myTable SET date1 =null where 1=2 HTH /Kejpa
  7. Alright, new approach, my last post on this issue didn't help me out much :( I've created the attached solution, a random generator server which should be called from a remote client through some inbetween manager which raises events when a request comes and another when the random has been generated. When I run the client (after the server been started) I get the following message: http://www.xtremedotnettalk.com/attachment.php?attachmentid=5416&stc=1 Any help appreciated /Kejpa CliServ.zip
  8. But... Why? If you want a copy for test/development you can use the same sql-server, just use another db in the same server. Or you can use a free version of sql server on your development computer. If it's a production web project you better not use access since it's not intended to be used with multiple users. Regards /Kejpa
  9. Yee! Thanks Cags, it's working now :) Best regards /Kejpa
  10. Hi! At first it wouldn't compile but then I changed the line as shown in my previos post and then it compiled. But I still can't change the limits in the Properties window as I like. They appear dimmed, and act as read-only :( I didn't have <TypeConverter(GetType(UpperLower))> on the property, I added it and it didn't make any difference. Really appreciates all the help I get! /Kejpa
  11. Just a quickie... Why two tables? The only reason for the first table would be to create a unique key to use in the second, right? Why not... Forecast Table --------------------- CustomerID ProductID Month Year ForeCastQuantity /Kejpa
  12. Sorry Cags :( Somehow it won't work.... I changed one of the lines that wouldn't compile If TypeOf destinationType Is String And TypeOf value Is UpperLower Then ' Changed to... If destinationType Is Type.GetType("System.String") And TypeOf value Is UpperLower Then Could that be the reason? /Kejpa
  13. Thanx! I guess I could work it out in VB, but if you would post it I'd be very happy! Regards /Kejpa
  14. Hi, I have a property which contains an upper/lower combination that I have declared my own structure for. How do I make it editable in the properties window when I put my control on a form? It's visible, but I can't set the values, I want it to show up just like the location with a small + that expands to show Upper and Lower values. TIA /Kejpa
  15. OK, so I found .NET remoting in simple english and it got me going a bit. I'll have a class library with a messenger class. I think I will make a Public Event for setting different server properties having different server classes add handlers for it. What I'm not so sure about is how to get the server classes properties. How should the client get the settings? I guess I'd better make it asyncronous, but I'm not sure how to make it. One of the classes I like to communicate with is CommPorts 3 which is a part of a CommPorts collection class containing all the existing ports on the computer. It has a Properties-property for all it's settings which I would like to get and set from my remote client. Another one is a Device called BP which is a part of a Devices collection class with a string identifyer This is as far as I'm currently... Public Class cHermes Inherits MarshalByRefObject Public Delegate Sub UpdatedPropertyHandler(ByVal sender As Object, ByVal e As UpdatedPropertyEventArgs) Public Delegate Function ObjectPropertyDelegate(ByVal Identifyer As String) As IAsyncResult Public Event UpdatedPropertyEvent As UpdatedPropertyHandler Public Overrides Function InitializeLifetimeService() As Object 'This function, if overriden, allows us to tell the Manager object how long 'it should live. If by any reason we'd like to have it stay a 'lil longer, we renew it and so forth 'We won't do anything here. So what happens is that 'the Manager object is governed by a default lifetime. Return Nothing End Function Public Function GetCommPortProperties(ByVal CommPort As Short) As ObjectPropertyDelegate ... End Function Public Sub SetCommPortProperties(ByVal CommPort As Short, ByVal Properties As Specialized.ListDictionary) ... End Sub Public Function GetDeviceProperties(ByVal Devicename As String) As ObjectPropertyDelegate ... End Function Public Sub SetDeviceProperties(ByVal Device As String, ByVal Properties As Specialized.ListDictionary) ... End Sub End Class Public Class UpdatedPropertyEventArgs Inherits EventArgs Private _Identifyer As Object Private _Properties As Specialized.ListDictionary Public Sub New(ByVal Identifyer As Object, ByVal Properties() As DictionaryEntry) _Identifyer = Identifyer _Properties = New Specialized.ListDictionary For Each itm As DictionaryEntry In Properties _Properties.Add(itm.Key, itm.Value) Next End Sub Public Sub New(ByVal Identifyer As Object, ByVal Properties As Specialized.ListDictionary) _Identifyer = Identifyer _Properties = Properties End Sub End Class Any help appreciated! /Kejpa
  16. I thought so too, but I haven't been able to find any suitable samples. Anyone have samples to point to or share? TIA /Kejpa
  17. Hi, I have a server app (eventually running as a service) that will listen on some COM-ports and makeing calculations based on data recieved. Calculations can have different parameters which I want to be able to change from the Client App that can be run both from the local machine or from a networked computer (no firewalls in between). Which is the best way to implement this, in VB6 we used DCOM (with much headache during setup). Some basic samples would be nice too ;) TIA /Kejpa
  18. Hi, I have a really quick routine for finding next file to read, but I thought it would be great to have it running in the background and restart it when it's needed. I tried to create the thread in the constructor and call it for the first time from there. _trdFindNextFile = New Threading.Thread(AddressOf FindNextFile) _trdFindNextFile.Start() And when I need it again I tried _trdFindNextFile.Start() Private Sub FindNextFile() Trace.WriteLineIf(trcMainTrace.Info, "Looking for next log file", "cReadDemo.FindNextFile") _NextFile = _File _trdFindNextFile.Join(0) End Sub But I get an error telling me the thread is either running or stopped and can't be restarted :( It's obviously not running, how should I restart it?!? TIA /Kejpa
  19. Hi, if this is the only insert/update/delete you do then using transactions is overkill. You should use transactions if you do multiple changes in the database that have to be all successful. It's not the case here, at least not from what you've shown. HTH /Kejpa
  20. What database? If you're using mySQL there's a REPLACE command that inserts if not present and updates (actually deletes and updates) if present. Generally I sould say trying to insert and failing is faster than checking and then inserting. If you insert and the key is present then the insert fails, no harm done. HTH /Kejpa
  21. Hi, I'd like to create a toolbar that is hidden until I move over some specified area when It becomes visible. Something like what's in the IDE when you set windows to AutoHide. Which components from the toolbox should I use? TIA /Kejpa
  22. Hi! I need some kind of reporting tool with options to export as pdf for VB.Express 2005. I thought CR was included but I can't find it, is it there? TIA /Kejpa
  23. I don't think you should be using a SQLDataSource with MySQL, you probably need a OdbcDataSource and the MySQL odbc-driver... HTH /Kejpa
  24. Why not use BETWEEN key word? SELECT s.SalesPK, s.SalesDate, s.SalesTime, s.TableName FROM tblSales s WHERE s.SalesPK <> 0 AND CONCAT(SalesDate, ' ', SalesTime) between '2005-11-11 01:00:00' AND '2005-11-11 14:00:00' ORDER BY s.SalesPK ASC /Kejpa
  25. SELECT RCDATE , RCTIME, concat(RCDATE ,' ' ,RCTIME) FROM tblRC works for me! /Kejpa
×
×
  • Create New...