|
Eddy Vluggen wrote: We got carried away while answering, but we enjoyed it
That's OK then!
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.
|
|
|
|
|
Thank you for your reply. It seems very useful and worth a book-mark. I've tried Google'ing for the information various ways, but I found oodles of pages that didn't really show what I was looking for. The "hidden" MSDN page you pointed me to looks like just what I was looking for (though the other links seem worth a gander as well). I wish Microsoft would have a more useful internal link structure to make it easy to find such information. In any case, I'm glad you pointed me to it. Thanks again.
|
|
|
|
|
Thanks, and you're welcome
|
|
|
|
|
Hi Good Day!
I'm new in Web development using ASP.net with C#.net page language..
I have some question for those really know about the WEB SERVICE..is it really possible that WEB SERVICE send to the WINDOWS SERVICE these two parameters DATEFROM and DATETO.
The WINDOWS SERVICE execute the T-SQL which the parameter value entered by the user.
Thanks And More Power
HONORABLE
|
|
|
|
|
Web-Services works on a request/response architecture. It can't do anything until there is a request for it. That said, a web-service can't send anything to a windows service.
Windows service can access this web-service to get information instead.
|
|
|
|
|
|
It is possible - you'll have to use remoting to do this, but it is possible. Basically, you'll need to define an interface that you will use on both sides:
public interface IUpdate
{
void UpdateDatabase(DateTime from, DateTime to);
} Then, you'll implement this interface in your windows service inside a class that derives from MarshallByRefObject. To activate this object from your web service, you use code that looks similar to:
TcpChannel clientChannel = new TcpChannel();
ChannelServices.RegisterChannel(clientChannel, false);
IUpdate upd = (IUpdate)Activator.GetObject(typeof(IUpdate), "tcp://myserver:1234/UpdateClass); This example assumes that your server is called myserver, that it remotes on port 1234, and that the class that you connect to is called UpdateClass.
At this point, you can call
upd.UpdateDatabase(dateFrom, dateTo); It's that simple.
"WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|
|
In a simpler way you can write a small xml file to store your dates from WebService.
You Windows Service would keep polling the file and picks the dates whenever it gets the values.
Now with a more complicated implementation would be have the Remoting implementation (which is already suggested).
A bit more complicated and proper implementation might be Microsoft Message Queueing. In this way, keep one Message Queue to send your data from WebService in the Queue. Your Windows Service would pick from there. Please visit the <a href="http://articles.techrepublic.com.com/5100-10878_11-6170794.html">blog</a>[<a href="http://articles.techrepublic.com.com/5100-10878_11-6170794.html" target="_blank" title="New Window">^</a>]which will help you about messaging beween processes.
Now you decide the approach better suitable for you.
Enjoy..
|
|
|
|
|
sir,
1)can u tell me the code how to display the entire row selected from datagridview control at runtime into textbox control
2)code for how to bind a checkedlistbox control into datagridviewcontrol without using a wizard
|
|
|
|
|
Hi all, we currently have a 100k+ LOC client/server application, not yet finished but close to be ready. Suddently, our customer decided that he needs the client/server comunication to cross nat/firewall boundaries, but remoting uses 2 channels and this makes it harder. We considered using WCF (wich we *hope* allows bidirectional communication through 1 channel), but then we discovered that support for generics and interfaces in services methods is limited due to WSDL restrictions. Of course, our system is heavily based on generics and interfaces (i.e. our custom DBRM) and using WCF would require deep changes in the whole architecture (most probably months of work).
My question is: is there any other option we could consider, and what is your suggestion?
Thank you!
|
|
|
|
|
Hi,
I have to create a form in VB.net that can write records on a mdb file on my website and also retrieve records from it.
I have never done any web programming, so I want to know how I can do it. Are there any sample codes available on the web? or can someone suggest me a book which explains such work.
Thanks and regards,
Neil Ranjan
|
|
|
|
|
There are loads of articles available here on Code Project on using a database and ASP.NET. Alternatively, there's this section[^] on the ASP.NET site (complete with screencasts) that just might help.
"WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|
|
I have an application wich adds items to a listview with groups. Then, I want to sort the items within the groups by the header clicked. I've created an icomperer class and works perfect on Windows Vista (development machine). But when I put this on the running machine (Windows XP) this doesn't work, when I click a header it only flickers but doesn't sort. I'm a little shocked, and I don't know what to do.
Thanks in advance for your time.
|
|
|
|
|
Hi,
First of all thanks for your support and time. I have a requirement to implement method level logging and instrumentation for my project.
what this means is , when a method runs , i need to track the time elapsed for the method. This should be happening without developer calling any code.
It should be set up in the framework( i mean i should write some code in framework which will enable logging and instrumentation and log start time and end time and elapsed time for every method in my project.
Any tips??
Thanks
Santhosh
|
|
|
|
|
|
Have a look at Post#[^] - it's an AOP framework for .Net which might be just what you're looking for. I haven't used it in a commercial project, so can't comment on its suitability in real world environments, but from what I've been able to test I have been very impressed.
print "http://www.codeproject.com".toURL().text
Ain't that Groovy?
|
|
|
|
|
This might also be a direction you may want to investigate:
http://www.postsharp.org/[^]
[EDIT- Ha! Martin must have been posting just as I was! He wins ]
|
|
|
|
|
I wonder if anyone can help.
I am upgrading a Windows Application from Visual Studio 2003 to 2005. After running the conversion wizard and changing/rewriting several methods I got the app to compile (already works perfectly in VS 2003)
However when running the project with a Debugger attached in 2005 and I select the open file dialog box which executes the below code I get the error "Current Thread must be set to single thread apartment (STA) mode before OLE calls can be made. Ensure that your Main Function has STAThreadAttribute marked on it. This exception is only raised if a debugger is attached to the process.".
The stack trace is shown as
at System.Windows.Forms.FileDialog.RunDialog(IntPtr hWndOwner)
at System.Windows.Forms.CommonDialog.ShowDialog(IWin32Window owner)
at System.Windows.Forms.CommonDialog.ShowDialog()
at Pupil_Accounts_Final_App.frmmain.importbob() in C:\Documents and Settings\*****\My Documents\Visual Studio 2005\*****Accounts App V2 database upgrade\frmmain.vb:line 379
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
So I then went into my puplicMain class which invokes the form (frmmain) where the button is located for calling the code to start the threaded process to call the method to open the dialog and added the SingleThreadAttribute as shown in the main code below, however the same error is still thrown. I then added this attribute to the button click event and the method (again shown below) but again same problem again.
I have been searching about the Web for several hours trying to find a solution however found one similar article which suggested removing all old DLL files in the BIN directory, I tried this still no luck. Does anyone have any idea what my problem could be? MSDN and all my other usual methods of debugging are just not working with this...
Method for open dialog:
STAThreadAttribute() _
Private Sub importpupils_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnimportbob.Click
'starts threading to make program appear faster and optomise performance
Dim t As New Thread(AddressOf importbob)
t.Name = "Import Bob"
importPupilsThread = True
t.Start()
End Sub
<STAThreadAttribute()> _
Public Sub importbob()
'this sub open's a stream reader so bob's master file can be taken into the program
Dim file As FileStream
Dim inputstream As StreamReader
Dim temp As String
Dim item As ListViewItem
Dim i As Integer
open.Filter = "CSV File (*.csv)|*.csv"
If open.ShowDialog = DialogResult.OK Then
Try
file = New FileStream(open.FileName, FileMode.Open)
inputstream = New StreamReader(file)
Catch ex As Exception
MsgBox("A Exception has occured." + vbCrLf + ex.Message)
Exit Sub
End Try
btnimportbob.Enabled = False
Try
Do While inputstream.Peek > -1
temp = inputstream.ReadLine
item = bobslist.Items.Add(temp.Split(",", 11, StringSplitOptions.None)(0))
For i = 1 To 10
item.SubItems.Add(temp.Split(",", 11, StringSplitOptions.None)(i).Trim)
Next
Loop
Catch ex As Exception
MsgBox("A exception has occured. You may have imported the wrong file or the file is corupt" + vbCrLf + ex.Message)
inputstream.Close()
importPupilsThread = False
Exit Sub
End Try
inputstream.Close()
End If
importPupilsThread = False
btnimportseemis.Enabled = True
End Sub
Main entry point to the program publicMain
Module publicmain
Public Const appversion As String = "2.0.0"
Public Const appauthor As String = "*****"
Public Const apptitle As String = "*******"
Public MainForm As frmmain
Public importPupilsThread As Boolean = False
Public importSeemisThread As Boolean = False
Public nextThread As Boolean = False
' Main entry point in to application
' Creates new instance of the main form then shows the dialog
<STAThreadAttribute()> _
Sub Main()
MainForm = New frmmain()
MainForm.ShowDialog()
End Sub
|
|
|
|
|
Hi,
I don't think you can use STAThreadAttributes for that purpose. Here are two possible solutions:
1. do you user interaction before you start the thread;
2. or set Thread.ApartmentState before calling Thread.Start
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.
|
|
|
|
|
Luc,
Great thanks for your help on this, problem resolved. It would appear that the Thread.ApartmentState method has been depricated by Microsoft however i replaced this by the below before starting the thread and all works great thanks for your help. If this is anyhelp to anyone I have posted the code below.
Private Sub importpupils_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnimportbob.Click
Dim t As New Thread(AddressOf importbob)
t.Name = "Import Bob"
importPupilsThread = True
t.SetApartmentState(ApartmentState.STA)
t.Start()
End Sub
|
|
|
|
|
am study from book MCTS 70-536 the book that by microsoft with orange cover not the black one okay
my problem is ,,, i dont have the SourceCode CD and am at lesson
Serializtion
i have this lab that want me to serialize class called person and i must copy it from the cd and i dont know but really i need somebody to help me to can understand this lab
please someone tell me what i have to do and am just beginner and dont know how to write a class can become same like person
|
|
|
|
|
H.Hemdan wrote: am just beginner and dont know how to write a class
I am quite surpise that you are saying the you are just a beginner and don't know how to write class And you started reading MCTS- 70-536, Which is Microsoft .NET Framework Certificationm Training Kit.
I will suggest you to please buy some beginners books. Go through the Books, done some hands on, then only go for 70-536 Book.
|
|
|
|
|
Hi,
I've got a dll that is registered on a machine using
<br />
regasm /codebase blah.dll
this dll works fine
During an upgrade I copy a new version of the dll over the top (on reboot if locked)
A VB6 App (yes you red that right) then tries to run the dll and on some machines I get an automation error, this doesn't seem to be OS related and I can't find any other common factor between the machines
rerunning
<br />
regasm /codebase blah.dll
fixes the problem
Does anyone know why this might happen, is there some kind of REGASM clean up process that might notice that I deleted the old dll before the new one gets written and unregisters it?
Cheers
Russell
|
|
|
|
|
It may be because you registered the 1st copy of the .DLL with a set of GUIDs that are no longer valid in the second copy of the .DLL. If you are letting Visual Studio generate the GUIDs or are otherwise not specifically generating and assigning them manually, yourself, you can have this kind of problem. All classes and interfaces exposed through COM are done using GUIDs. If these GUIDs changes between revesions of the .DLL, just copying the new .DLL over the top of the old one will break these GUID/class/interface associations.
|
|
|
|
|
Thanks for the reply.
It seems that it's a version numbering issue, the guids are hard coded in the project at the moment, the interfaces are fine. The problems also appear to have happened since we fixed a build script issue that was failing to change the version numbers on build.
So, now i understand why the thing is breaking but now fail to see why it ever works
This should at least be a bit easier to diagnose.
I think I might sleep on it and see what the problem is.
Russell
|
|
|
|