|
Hi
It is not possible. Bind to datagrid using dataset and fill the dataset using DataAdapter.
Harini
|
|
|
|
|
Hi,
Thanx for your reply
|
|
|
|
|
Hi.
I want to print a pdf file from C# code.
For this I found a "not-very-elegant, but will-do-for-now" type of solution:
Call AcrobatReader with command line parameters which tell it to print the file:
System.Diagnostics.Process.Start("C:\\Program Files\\Adobe\\Acrobat 7.0\\Reader\\Acrord32.exe",<br />
"/t \"mytest.pdf\" \"MyWindowsPrinterName\"");
It works, but the drawback is that the AcrobatReader program is opened and stays open afterwards. It starts minimized thanks to the "/t" parameter in the call, but it's still open.
So I'm thinkin' of killin' the AcroRd32.exe process after it has completed it's mission.
Now the question: When can the AcroRd32 process be killed without fear of undesirable side-efects(exceptions, etc)?
If I kill it immediately after the call, the file never gets printed.
How can I check that the print job has been enqueued to the printer?
Thanks for having the patience to read.
|
|
|
|
|
System.Diagnostics.Process.Start returns a Process object which you can use to kill it later..
another drawback is acrobat readed's path.. it can be different for everybody..
life is study!!!
|
|
|
|
|
Seishin# wrote: life is study!!!
Errrr...OK
There are 10 types of people in the world, those who understand binary and those who dont.
|
|
|
|
|
what?!.. you learn throughout your whole life...
besides watch GoldenBoy, then we'll talk
life is study!!!
|
|
|
|
|
Seishin# wrote: System.Diagnostics.Process.Start returns a Process object which you can use to kill it later..
Well, yes. That's not the problem. The problem is I have to wait until the document is sent for printing(that takes some time from the moment the process is started) and kill it afterwards.
Seishin# wrote: another drawback is acrobat readed's path.. it can be different for everybody..
Yes, I'll see how I can find that after I take care of the current issue.
|
|
|
|
|
blackjack2150 wrote:
Seishin# wrote:
another drawback is acrobat readed's path.. it can be different for everybody..
Yes, I'll see how I can find that after I take care of the current issue.
There is probably a key in the registry that holds the path.
There are 10 types of people in the world, those who understand binary and those who dont.
|
|
|
|
|
Were you able to find a solution? I'm having the same problem. I don't want to just wait X number of seconds and then kill the process, that's kinda ugly.
|
|
|
|
|
Hi. Nope and the feature was ultimately abbandoned. In the meanwhile I also changed jobs.
I remembers there was a solution that used Ghostscript and gsprint (http://pages.cs.wisc.edu/~ghost/gsview/gsprint.htm[^]), but IIRC it was dual-licensed and you had to pay to use it in commercial software.
All the best!
|
|
|
|
|
Can you please tell me how to write the contents to the pdf file because it will be helpfull to me as i am creating asame type of applicaiton
Best Regards,
M. J. Jaya Chitra
|
|
|
|
|
Hello
I want to change the property of column header in datagridview.
Reply me asap.
Thanks
Devesh Mishra
|
|
|
|
|
There are lot of propeties present in the DataGridView Class for column header in MSDN.
Please refer MSDN. some of them are,
- ColumnHeadersBorderStyle
- ColumnHeadersDefaultCellStyle
- ColumnHeadersHeight
- ColumnHeadersHeightSizeMode
- ColumnHeadersVisible.
Praveen Raghuvanshi
Software Engineer,
Wins Infotek Pvt. LTd.
India.
|
|
|
|
|
Thanks man...
Devesh Mishra
|
|
|
|
|
Hai everybody,
Can u give me a hint how to make two windows service to communicate.
Best Regards,
M. J. Jaya Chitra
|
|
|
|
|
Hi Jaya,
One way is to use Remoting.
You can also use MSMQ. There might be more ways of doing this. The best way needs to be figured out based on your application requirements.
i Think, i Wait, i Fast rAm
|
|
|
|
|
As ganti pointed out, there are more ways to let the service communicate with eachother. Another option is using a memory pipe to communicate. But I personally think remoting might be a better solution.
WM.
What about weapons of mass-construction?
"What? Its an Apple MacBook Pro. They are sexy!" - Paul Watson
|
|
|
|
|
What do you mean my remoting can you give me a reference site for it.
Best Regards,
M. J. Jaya Chitra
|
|
|
|
|
|
Yes.
you have to define URL with IP Address in Remoting.
Pavan Pareta
|
|
|
|
|
We use MSMQ. That way the second windows service can just wait till the first Windows service puts something on the queue before it tries to do anything.
Ben
|
|
|
|
|
Hello together,
I have to get the full username. My solution only gets it for local users but I need it also when the user is logged in by a domain account. Has anybody an idea how do get this?
using System;<br />
using System.Runtime.InteropServices;<br />
<br />
namespace UserInfo<br />
{<br />
public class Program<br />
{<br />
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]<br />
public struct USER_INFO<br />
{<br />
[MarshalAs(UnmanagedType.LPWStr)]<br />
public String username;<br />
[MarshalAs(UnmanagedType.LPWStr)]<br />
public String password;<br />
[MarshalAs(UnmanagedType.LPWStr)]<br />
public String comment;<br />
[MarshalAs(UnmanagedType.LPWStr)]<br />
public String fullname;<br />
}<br />
<br />
[DllImport("Netapi32.dll", CharSet = CharSet.Unicode, ExactSpelling = true)]<br />
private extern static Int32 NetUserGetInfo(<br />
[MarshalAs(UnmanagedType.LPWStr)] String ServerName,<br />
[MarshalAs(UnmanagedType.LPWStr)] String UserName,<br />
Int32 level,<br />
out IntPtr BufPtr);<br />
<br />
[DllImport("Netapi32.dll", SetLastError = true)]<br />
static extern Int32 NetApiBufferFree(IntPtr Buffer);<br />
<br />
public static String GetFullname()<br />
{<br />
String retVal = String.Empty;<br />
<br />
try<br />
{<br />
USER_INFO objUserInfo = new USER_INFO();<br />
IntPtr bufPtr;
Int32 lngReturn = NetUserGetInfo(Environment.MachineName, Environment.UserName, 10, out bufPtr);<br />
if (lngReturn == 0)<br />
{<br />
objUserInfo = (USER_INFO)Marshal.PtrToStructure(bufPtr, typeof(USER_INFO));<br />
retVal = objUserInfo.fullname;<br />
}<br />
NetApiBufferFree(bufPtr);<br />
bufPtr = IntPtr.Zero;<br />
}<br />
catch (Exception ex)<br />
{<br />
Console.WriteLine("GetFullname: " + ex.Message);<br />
}<br />
<br />
return retVal;<br />
}<br />
<br />
public static void Main(String[] args)<br />
{<br />
Console.WriteLine("Login name: " + Environment.UserName);<br />
Console.WriteLine("Full username: " + GetFullname());<br />
Console.ReadLine();<br />
}<br />
}<br />
}
Greets
Patrick
|
|
|
|
|
Try this:
Environment.UserDomainName + "\\" + Environment.UserName
It should return "domain\user"
There are 10 types of people in the world, those who understand binary and those who dont.
|
|
|
|
|
How can I create win application that may launch through local network from another PC, where it is installed?
When I start application through network appears below error:
System.Security.SecurityException was unhandled
Message="That assembly does not allow partially trusted callers."
Source="SqlTool"
StackTrace:
at System.Security.CodeAccessSecurityEngine.ThrowSecurityException(Assembly asm, PermissionSet granted, PermissionSet refused, RuntimeMethodHandle rmh, SecurityAction action, Object demand, IPermission permThatFailed)
at SqlTool.frmSql.Main()
at System.AppDomain.nExecuteAssembly(Assembly assembly, String[] args)
at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.runTryCode(Object userData)
at System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
How to solve this problem?
Thanks for any answer.
|
|
|
|
|
Run a search on all previous questions, I remember answering this question last week I think.
There are 10 types of people in the world, those who understand binary and those who dont.
|
|
|
|