|
Hi all,
i want to open an existing word document in a folder in the project,path of that file is stored in oracle table.
When i click a link button a query should be executed to take the corresponding path,then with that path the file should be opened.
i tried like this..
Private Sub Linkbutton6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Linkbutton6.Click
Dim str As String
Dim command As String = "SELECT FILENAME FROM S_TR_BUILDDATA A WHERE 1= (SELECT COUNT(DISTINCT B.DATEOFBUILD ) FROM
S_TR_BUILDDATA B WHERE A.DATEOFBUILD <=B.DATEOFBUILD) "
Dim DFmenu As DataSet = Me.ExecuteSql(command)
str = DFmenu.Tables(0).Rows(0).Item(0)
System.Diagnostics.Process.Start(str)
' Response.Redirect(str)
End Sub
its getting filled in dataset..
but the file is not opening..
what shall i do???
thanks n regards,
kums
|
|
|
|
|
How to check the check boxes in the mailbox
by using the shift key.
|
|
|
|
|
anandbprem wrote: How to check the check boxes in the mailbox
by using the shift key.
Is that a question and then answer? Or is it something else. You might want to try and express that in a different way.
|
|
|
|
|
In datagridview when press any key then from that column select the Cell strats with that latter. How can i do tht the Grid is already bound.
|
|
|
|
|
Something like the following should get you started toward a solution.
private void yourDataGridView_KeyPress(object sender, KeyPressEventArgs e)
{
foreach (DataGridViewColumn column in yourDataGridView.Columns)
{
if (column.HeaderText.StartsWith(e.KeyChar.ToString()))
{
column.Selected = true;
break;
}
}
}
You will also need to pay attention to the EditMode property of the DataGridView , to stop the grid going into an edit state when the key is pressed. Read the documentation for EditMode for the options.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
Hello,
When I call SDI winodw form from modal window and then again modal window form, from SDI window and when i close the last form the focus goes to first modal window istead of going to SDI window ... Can anybody tell me Why it happens ?
First window (Form1) ---> Call modal window on button click (Form2 f2=new Form2(); f2.showDialog();)
---> from Form2, Call SDI window (Form3 f3=new Form3(); f3.show()) -----> From Form3 call another modal window (Form4 f4=new Form4(); f4.showDialog();
When I close the fourth form the focus goes to Form2 instead of Form3 why It happens ? And it happens in case of compact framework C# ....
Regards
Rajesh
|
|
|
|
|
I am trying to create a licencing class library whereby an attribute is added to the AssemblyInfo.cs and when the assembly is loaded (not using Assembly.Load) validation is performed to see if the assembly has the attribute and then checks a licence key to ensure it can be run.
I thought the AppDomain.AssemblyLoad event might work, but after testing I am now assuming that only fires when you use Assembly.Load. I am a bit stuck as to whether this can be achieved and how.
I will eventually like to be able to do this validation at class level so that if someone tries instantiating an instance of the class, a licence is checked for access. One method is to use a proxy type mechanism like the Enterprise Library Injection Policy Application block, but ideally I would like it to fire is someone does the usual Foo f = new Foo(). The class level validation would ideally not have to be duplicated in every class (e.g. added to the constructors).
Any ideas on how to do this?
|
|
|
|
|
Hi,
I don't know about assembly events. However IMO you might be able to get what you want by adding code to the static constructor of the class you want to protect; in order to protect several classes, let their static constructors access the one class that takes care of licensing.
Luc Pattyn [Forum Guidelines] [My Articles]
DISCLAIMER: this message may have been modified by others; it may no longer reflect what I intended, and may contain bad advice; use at your own risk and with extreme care.
|
|
|
|
|
Thanks Luc.
I agree that I think my only option is going to be to add some code to the constructors of the classes I want to protect. I think I may also be able to use some interface that defines a method that adds a class type to some licence manager class.
Well off I go again for some more experimentation.
|
|
|
|
|
It it possible/practical to have an application which will accept an incoming TCP connections, communicate enough to identify the remote device, and then hand the socket to either a newly-launched executable or one which is already running? What would be the best way of doing that?
I'd like to have a service that will accept connections on a particular registered TCP port, which would ask the connecting device to identify itself and then use its returned identity to select one of a number of programs to access it. If someone is running an interactive application to handle the connecting devices, the connections should be routed to that application.
One approach would be to have the application allocate a new temporary port and notify the service that it has done so; the service could then act as a proxy exchanging all information between the remote device and the 'real' application. That would add extra overhead, however; it would seem more efficient for the service to hand off the connection to the application so the application would handle the incoming data directly.
Is there any nice way to accomplish this in .net?
|
|
|
|
|
|
Thank you. That looks very useful, at least in the case of handing off the socket to an already-open application. What would be the preferred method of handing off a socket to an application which isn't yet launched (assuming .net 2.0)? I've not used named pipes, since the managed API's for those FWIU only appeared in .net 3.5, though if they're easy to use from .net that might be handy. Otherwise I could have the newly-launched application "telnet" into the service port, say "hey I'm here, this is my process ID, and I'd like a socket if you have one"; the service could then give the socket to the new application.
One of my design goals is to minimize the possibility of the service imposing an excessive burden on the system even if things go wrong (e.g. a connection comes in and the service launches the application, but the application never gets around to dealing with the port). I don't particularly like the idea of the service having to hold the connection until the application gets around to asking for it, but it wouldn't be too horrible. I could probably have a 30-second timeout or something on it (if the application hasn't picked up the socket by then, the remote device that's "telnet"ing in will likely give up anyway), but that adds some complexity.
BTW, what's the best style for using the Select function? Creating three lists from scratch each time I want to poll for data, and then using a dictionary to map the connections in each list back to my own connection-info objects seems rather klunky.
|
|
|
|
|
For interprocess communication between processes on that same machine,
I'd just use .NET remoting. The IpcChannel/IpcServerChannel/IpcClientChannel
classes are efficient, and probably use named pipes for their transport.
supercat9 wrote: what's the best style for using the Select function?
I don't know - I never use it, and I personally think it's kind of dated.
I much prefer I/O completion ports or the asynchronous APIs in .NET. Thread pool
stuff is much more efficient.
I prefer a class that represents/wraps a connection (e.g. a socket) and handles
its own asynchronous I/O.
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Mark Salsbery wrote: I prefer a class that represents/wraps a connection (e.g. a socket) and handles
its own asynchronous I/O.
I never really got a grasp of how to asynchronous I/O with operations that may need to time out or be aborted; I've read that there isn't really good support for that. I think the concern by the socket implementors was that if an application times out or otherwise decides to abort an operation with a TCP socket, there's no guarantee as to what data may or may not be 'in transit'. Certainly such an issue is reasonable, but in some cases it may be easier and cheaper to recover from the 'unknown data' scenario than to close and reopen the socket. For example, if the remote system includes an 'echo' command, the PC can ask the remote machine to echo back a GUID, repeating the request until the proper GUID is echoed(*). Once the proper echo is received, the PC will know that the only thing that could possibly be in the transmit pipe would be more copies of the 'echo' command, and the only thing that could possibly be in the receive pipe would be more copies of the echoed GUID.
(*) If both endpoints were running TCP natively, there would be no point in retransmitting the data. On the other hand, many embedded systems use a TCP-to-serial gateway, and there is a possibility of data loss on the serial link.
What would be the best way to set up an application if it has to be able to exchange data via the following three methods, interchangeably:
-1- TCP socket
-2- Serial port
-3- Thread which polls a custom USB device each millisecond to see if there's any data
Are there any good example programs showing how best to do such things?
|
|
|
|
|
supercat9 wrote: asynchronous I/O with operations that may need to time out or be aborted; I've read that there isn't really good support for that. I think the concern by the socket implementors was that if an application times out or otherwise decides to abort an operation with a TCP socket, there's no guarantee as to what data may or may not be 'in transit'.
Is it really an issue in practice with TCP? If you implement a timeout or abort you run the risk of data loss
regardless - there's no way for an endpoint to know what the other endpoint is about to do.
supercat9 wrote: What would be the best way to set up an application if it has to be able to exchange data via the following three methods, interchangeably
I don't know, beyond making a base common interface then implementing three derived
implementations that implement the interface for the given communication type.
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Mark Salsbery wrote: Is it really an issue in practice with TCP? If you implement a timeout or abort you run the risk of data loss
regardless - there's no way for an endpoint to know what the other endpoint is about to do.
Is there any practical way to abort an asynchronous TCP operation without closing a connection, if one is willing to accept the loss or late arrival of data prior to the abort, but one wants to avoid memory or resource leaks, weird crashes, etc.? I know that in many of the applications for which TCP is designed, dropping a connection would be preferable to losing data while keeping a connection, but when dealing with embedded systems that isn't always true.
Also, btw, is it safe to have one thread write to a socket while a different thread reads it? I know that having two threads writing or two threads reading would likely be problematical at best, but the write/read case would seem common enough I would hope the implementors would have handled it correctly.
|
|
|
|
|
supercat9 wrote: is it safe to have one thread write to a socket while a different thread reads it?
I've never seen it documented, and may never, but it works on Windows and I rely on it working
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Thanks for your help. I think I have a workable approach for the handoff (at least my simple test apps work fine). As for aborting an asynchronous operation, I've decided the best approach is probably to have the asynchronous receive handler call a delegate for the incoming data. That way, if I give up on receiving one type of data and want to start looking for another type, I don't need to abort the pending receive--I can simply leave it pending; when data comes in, it will go to the new delegate.
|
|
|
|
|
supercat9 wrote: What would be the preferred method of handing off a socket to an application which isn't yet launched
I would prefer not to do that. So I would want to have zero other choices before adopting that approach. Keep it simple by just having the new process start a new connection and design session and application protocol for aligning the data that is transmitted. Passing sockets across applications just sounds like a bad idea. Of course I don't have your complete requirements, I'm just saying I would think that is a last resort.
|
|
|
|
|
I agree. And using TCP and sockets, the session IS the connected socket
so it's not very complex to implement.
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
I have a reserved TCP port for a class of applications which generally involve an electronic device (not a PC) connecting to a server. The first line of data sent from a device will identify the device type and serial number. Different devices will need to be handled by different applications. It is necessary to keep the remote end as simple as possible, since it's a relatively unsophisticated microcontroller.
While it might be possible to build a mega-application which would handle everything internally (indeed, that's what I have now) splitting things off into different applications should improve system reliability and extensibility.
|
|
|
|
|
|
Hi All.........
I know very well how to create crystal reports using Access and I am trying same method for sql server but its not working.
Is there any different method for creating a crystal report while working with sql server?
If any........suggest me.
Thanks.
-Neeta
|
|
|
|
|
hi...
I am working with sql server and vb.net.
I have a table with two fields i.e. serial number (SrNo) and Department Name (dept).
for ex:
SrNo dept
1 Finance
2 Hr
3 Production
when i am deleting any single row from the database then serial_number's sequence changed because of deleting a row.
Such as:
SrNo dept
1 Finance
3 Production
I want a help so that serial_number sequence should be arranged in a sequence automatically after deleting a row.
such as:
SrNo dept
1 Finance
2 Production
-Neeta
|
|
|
|
|
That goes against 'proper design'. See, those numbers are usually used to make a "connection" with another table.
SrNo dept
1 Finance
3 Production
Employee StationOnDept
Johnny 1
Neeta 1
Bill 3
We can use a query to determine who works where. Bill works at production, in the above example. Now, if you change the "3" that belongs with the "Production" to a "2", then Bill will still work at dept 3, even though it doesn't exist anymore.
You're likely to break your database as soon as you start messing with them numbers.
I are troll
|
|
|
|