|
Make sure your ImageList's ColorDepth property is set to a high value:
imageList.ColorDepth = ColorDepth.Depth32Bit;
|
|
|
|
|
Haha~
Add these code:
Application.EnableVisualStyles();
Application.DoEvents();
and set
Imagelist.ColorDepth = ColorDepth.Depth32Bit;
then it works!
thank you very much!
-- modified at 22:45 Monday 12th March, 2007
http://chinajuanbob.spaces.live.com/
|
|
|
|
|
i have a problem... How can i replace a control present in a container with another control in ComponentAdding/ComponentAdded event? This is required in UndoRedo Operation.I have the undone object with me.On redo an empty control is created with private variables as null.It is a custom control & i am having to reassign all the properties as the undo engine doesnt return the object that was previously removed.
Please suggest a way to get back the Undone control and paste it on the Designer Surface.
|
|
|
|
|
Does anyone have a working example of how to create an active X control that can be hosted in a local HTML document, i.e. not using IIS or a web server, just a plain HTML file that opened in IE will show the active X using WinForms.
Basically I am trying to create a google desktop sidebar gadget, with all the GUI and code being implemented in C#, the google gadget would look very simple
<view ...="">
<object name="myactivex" object="myactivex.mycontrol">
All the samples I have found will not load the Active X in IE, but do in the OLE/Active test harness.
|
|
|
|
|
Hi,
I need to run scrips(vbscripts, jscripts,PowerShell scripts) programatically from C# .Net and I didn't found nothing to help me.
Please help me to do this, giving me a simple exemple.
Thanks,
Lukas22
|
|
|
|
|
You can use System.Diagnostics.Process class to start a process, such as cscript.exe, and pass it parameters (such as the VBScript file).
|
|
|
|
|
Thank you for your solutin, but I have already tested it and unfortunatelly, I need to do this task without using Process.Start(). Is there another solution to solve this?
Lukas22
|
|
|
|
|
You're going to need to run an external process to execute the scripts, unless you write your own script interpreter, which is obviously a huge task. Practically speaking, running an external process is the only option. Why can't you use Process.Start?
|
|
|
|
|
Hi,
Hi I have 3 tables, one is master table( EMP) and other two are child tables (Emp_Dep and Emp_Jone).
Example:
EMP
EmpId Name
1 ABC
2 XYZ
Emp_Dep
EmpId DepId
1 2
Emp_Jone
EmpId JoneId
1 4
I have created these 3 tables and defined Relation objects between these three tables.
My problem is the order of updating in my application,
Case1:
If I update the tables in Emp_jone, Emp_Dep and Emp order, I am getting “constrain failed” exception, when I have add a new employee and linked with a Department and Jone. This would be resolved if I update in Emp, Emp_Jone and Emp_Dep
Case2:
If I deleted an existing employee, who has been liked with some Department and jone, and I update in Emp, Emp_Jone and Emp_Dep, I will get same constrain failed exception, to resolve this I will have to update as specified in Case1 order.
Could you please give me some suggestion to resolve this without any intermediate updates?
Regards,
Satish
Satish
|
|
|
|
|
Hi,
I have a picture box that has mousemove event. I check to see whether the mouse is between certain cords and if it matchs one of the if statements, it should display a tooltip.
The problem is that since im using the mousemove event the tooltip is being redraw everytime the mouse is moved which causes some visual problems, e.g: the picture box displays alot of tooltips.
Any ideas?
Regards,
Gareth.
|
|
|
|
|
Create a boolean field in your class indicating if a tool tip is being shown. Only show a new tool tip if the field indicates there is no tool tip being shown.
|
|
|
|
|
Judah, I cant do that really since i want to show different tooltips for different areas of the picture box, thus i'd need to create a bool for each tooltip which seems like abit of a hash.
Surly theres a better way?
Regards,
Gareth.
|
|
|
|
|
if you use the variable like he suggested, then check the tooltip text to the text you want to show if they are the same don't update otherwise update the tooltip
|
|
|
|
|
Cheers, that fixed the problem.
Regards,
Gareth.
|
|
|
|
|
Hi there
I want to use a session variable to store the user_id, and then redirect to another page. the problem is, that when i get to the redirected page, in the page load event, the session variable is not there (when put onto a textbox). only when the page is refresed (F5), can i view the user_ID on the textbox.
Can anyone help me with this problem?
Thanks
|
|
|
|
|
check the session varaible's value before redirecting to next page
Regards,
Sylvester G
sylvester_g_m@yahoo.com
|
|
|
|
|
Hi,
I am raising RowAdded Event of DataGridView whenever rows are added to the
DGview. But it is raised even for the column Headers. and Column Headers are
also considered as a Row in this case.How can i eliminate this issue.
with Thanks
Sakthi.
|
|
|
|
|
Hey!
I have a wary simple webservice:
[WebService(Namespace = "http://test.net/")]<br />
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]<br />
public class companyService : System.Web.Services.WebService {<br />
<br />
private companyDatabaseHandler dbHandler = new companyDatabaseHandler();<br />
<br />
public companyService () {<br />
<br />
}<br />
<br />
[WebMethod]<br />
public string HelloWorld() {<br />
return "Hello World";<br />
}<br />
<br />
[WebMethod]<br />
public int getIdByGameName(string gameName)<br />
{<br />
try<br />
{<br />
if (gameName != null && gameName.Length > 0)<br />
return dbHandler.getBoardGameGeekGameIdByGaneName(gameName);<br />
throw (new Exception("gameName is not correct."));<br />
}<br />
catch (Exception ex)<br />
{<br />
throw ex;<br />
}<br />
}<br />
}
I can contakt this webservice with PHP using nuSoup. But when It arrives to getIdByGameName the gameName is null?
Here is the simple PHP software that are about to cosume the webservice:
index.php
<?php<br />
if (!isset($_POST['namn']))<br />
{<br />
echo '<form action="" method="post">';<br />
echo 'Spelnamn: <input type="text" name="namn" />';<br />
echo '<input type="submit"/>';<br />
echo '</form>';<br />
}<br />
else<br />
{<br />
require_once('nusoap.php');<br />
<br />
$wsdl = "companyService.wsdl";<br />
$client = new soapclient($wsdl, 'wsdl');<br />
<br />
$param = array(<br />
'gameName' => $_POST['namn']<br />
);<br />
<br />
$result = $client->call('getIdByGameName', $param);<br />
<br />
if ($err = $client->getError())<br />
{<br />
echo "The server returned error: $err";<br />
}<br />
else<br />
{<br />
echo "ID för spel med namn {$_POST['namn']} är: $result <br /><br />\n";<br />
}<br />
}<br />
?>
Then I have the fallowing WSDL(companyService.wsdl):
<?xml version="1.0" encoding="utf-8"?><br />
<wsdl:definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:tns="http://test.net/" xmlns:s="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" targetNamespace="http://test.net/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"><br />
<wsdl:types><br />
<s:schema elementFormDefault="qualified" targetNamespace="http://test.net/"><br />
<s:element name="HelloWorld"><br />
<s:complexType /><br />
</s:element><br />
<s:element name="HelloWorldResponse"><br />
<s:complexType><br />
<s:sequence><br />
<s:element minOccurs="0" maxOccurs="1" name="HelloWorldResult" type="s:string" /><br />
</s:sequence><br />
</s:complexType><br />
</s:element><br />
<s:element name="registerCompany"><br />
<s:complexType><br />
<s:sequence><br />
<s:element minOccurs="0" maxOccurs="1" name="inName" type="s:string" /><br />
<s:element minOccurs="0" maxOccurs="1" name="inWebUrl" type="s:string" /><br />
<s:element minOccurs="0" maxOccurs="1" name="inDescription" type="s:string" /><br />
<s:element minOccurs="0" maxOccurs="1" name="inContactName" type="s:string" /><br />
<s:element minOccurs="0" maxOccurs="1" name="inContactPhoneNr" type="s:string" /><br />
<s:element minOccurs="0" maxOccurs="1" name="inContactEmailAdr" type="s:string" /><br />
<s:element minOccurs="0" maxOccurs="1" name="inPassword" type="s:string" /><br />
</s:sequence><br />
</s:complexType><br />
</s:element><br />
<s:element name="registerCompanyResponse"><br />
<s:complexType><br />
<s:sequence><br />
<s:element minOccurs="1" maxOccurs="1" name="registerCompanyResult" type="s:int" /><br />
</s:sequence><br />
</s:complexType><br />
</s:element><br />
<s:element name="getCompanyId"><br />
<s:complexType><br />
<s:sequence><br />
<s:element minOccurs="0" maxOccurs="1" name="inName" type="s:string" /><br />
</s:sequence><br />
</s:complexType><br />
</s:element><br />
<s:element name="getCompanyIdResponse"><br />
<s:complexType><br />
<s:sequence><br />
<s:element minOccurs="1" maxOccurs="1" name="getCompanyIdResult" type="s:int" /><br />
</s:sequence><br />
</s:complexType><br />
</s:element><br />
<s:element name="removeCompany"><br />
<s:complexType><br />
<s:sequence><br />
<s:element minOccurs="1" maxOccurs="1" name="inCompanyId" type="s:int" /><br />
<s:element minOccurs="0" maxOccurs="1" name="inPassword" type="s:string" /><br />
</s:sequence><br />
</s:complexType><br />
</s:element><br />
<s:element name="removeCompanyResponse"><br />
<s:complexType><br />
<s:sequence><br />
<s:element minOccurs="1" maxOccurs="1" name="removeCompanyResult" type="s:int" /><br />
</s:sequence><br />
</s:complexType><br />
</s:element><br />
<s:element name="updateGame"><br />
<s:complexType><br />
<s:sequence><br />
<s:element minOccurs="1" maxOccurs="1" name="inCompanyId" type="s:int" /><br />
<s:element minOccurs="0" maxOccurs="1" name="inPassword" type="s:string" /><br />
<s:element minOccurs="1" maxOccurs="1" name="inBoardGameGeekGameId" type="s:int" /><br />
<s:element minOccurs="1" maxOccurs="1" name="inPriceEach" type="s:double" /><br />
<s:element minOccurs="1" maxOccurs="1" name="inShippingPriceSweden" type="s:double" /><br />
<s:element minOccurs="0" maxOccurs="1" name="inDirectLink" type="s:string" /><br />
</s:sequence><br />
</s:complexType><br />
</s:element><br />
<s:element name="updateGameResponse"><br />
<s:complexType><br />
<s:sequence><br />
<s:element minOccurs="1" maxOccurs="1" name="updateGameResult" type="s:int" /><br />
</s:sequence><br />
</s:complexType><br />
</s:element><br />
<s:element name="removeGame"><br />
<s:complexType><br />
<s:sequence><br />
<s:element minOccurs="1" maxOccurs="1" name="inCompanyId" type="s:int" /><br />
<s:element minOccurs="0" maxOccurs="1" name="inPassword" type="s:string" /><br />
<s:element minOccurs="1" maxOccurs="1" name="inBoardGameGeekGameId" type="s:int" /><br />
</s:sequence><br />
</s:complexType><br />
</s:element><br />
<s:element name="removeGameResponse"><br />
<s:complexType><br />
<s:sequence><br />
<s:element minOccurs="1" maxOccurs="1" name="removeGameResult" type="s:int" /><br />
</s:sequence><br />
</s:complexType><br />
</s:element><br />
<s:element name="getCompanyGames"><br />
<s:complexType><br />
<s:sequence><br />
<s:element minOccurs="1" maxOccurs="1" name="inCompanyId" type="s:int" /><br />
<s:element minOccurs="0" maxOccurs="1" name="inPassword" type="s:string" /><br />
</s:sequence><br />
</s:complexType><br />
</s:element><br />
<s:element name="getCompanyGamesResponse"><br />
<s:complexType><br />
<s:sequence><br />
<s:element minOccurs="0" maxOccurs="1" name="getCompanyGamesResult"><br />
<s:complexType><br />
<s:sequence><br />
<s:any minOccurs="0" maxOccurs="unbounded" namespace="http://www.w3.org/2001/XMLSchema" processContents="lax" /><br />
<s:any minOccurs="1" namespace="urn:schemas-microsoft-com:xml-diffgram-v1" processContents="lax" /><br />
</s:sequence><br />
</s:complexType><br />
</s:element><br />
</s:sequence><br />
</s:complexType><br />
</s:element><br />
<s:element name="getIdByGameName"><br />
<s:complexType><br />
<s:sequence><br />
<s:element minOccurs="0" maxOccurs="1" name="gameName" type="s:string" /><br />
</s:sequence><br />
</s:complexType><br />
</s:element><br />
<s:element name="getIdByGameNameResponse"><br />
<s:complexType><br />
<s:sequence><br />
<s:element minOccurs="1" maxOccurs="1" name="getIdByGameNameResult" type="s:int" /><br />
</s:sequence><br />
</s:complexType><br />
</s:element><br />
</s:schema><br />
</wsdl:types><br />
<wsdl:message name="HelloWorldSoapIn"><br />
<wsdl:part name="parameters" element="tns:HelloWorld" /><br />
</wsdl:message><br />
<wsdl:message name="HelloWorldSoapOut"><br />
<wsdl:part name="parameters" element="tns:HelloWorldResponse" /><br />
</wsdl:message><br />
<wsdl:message name="registerCompanySoapIn"><br />
<wsdl:part name="parameters" element="tns:registerCompany" /><br />
</wsdl:message><br />
<wsdl:message name="registerCompanySoapOut"><br />
<wsdl:part name="parameters" element="tns:registerCompanyResponse" /><br />
</wsdl:message><br />
<wsdl:message name="getCompanyIdSoapIn"><br />
<wsdl:part name="parameters" element="tns:getCompanyId" /><br />
</wsdl:message><br />
<wsdl:message name="getCompanyIdSoapOut"><br />
<wsdl:part name="parameters" element="tns:getCompanyIdResponse" /><br />
</wsdl:message><br />
<wsdl:message name="removeCompanySoapIn"><br />
<wsdl:part name="parameters" element="tns:removeCompany" /><br />
</wsdl:message><br />
<wsdl:message name="removeCompanySoapOut"><br />
<wsdl:part name="parameters" element="tns:removeCompanyResponse" /><br />
</wsdl:message><br />
<wsdl:message name="updateGameSoapIn"><br />
<wsdl:part name="parameters" element="tns:updateGame" /><br />
</wsdl:message><br />
<wsdl:message name="updateGameSoapOut"><br />
<wsdl:part name="parameters" element="tns:updateGameResponse" /><br />
</wsdl:message><br />
<wsdl:message name="removeGameSoapIn"><br />
<wsdl:part name="parameters" element="tns:removeGame" /><br />
</wsdl:message><br />
<wsdl:message name="removeGameSoapOut"><br />
<wsdl:part name="parameters" element="tns:removeGameResponse" /><br />
</wsdl:message><br />
<wsdl:message name="getCompanyGamesSoapIn"><br />
<wsdl:part name="parameters" element="tns:getCompanyGames" /><br />
</wsdl:message><br />
<wsdl:message name="getCompanyGamesSoapOut"><br />
<wsdl:part name="parameters" element="tns:getCompanyGamesResponse" /><br />
</wsdl:message><br />
<wsdl:message name="getIdByGameNameSoapIn"><br />
<wsdl:part name="parameters" element="tns:getIdByGameName" /><br />
</wsdl:message><br />
<wsdl:message name="getIdByGameNameSoapOut"><br />
<wsdl:part name="parameters" element="tns:getIdByGameNameResponse" /><br />
</wsdl:message><br />
<wsdl:portType name="companyServiceSoap"><br />
<wsdl:operation name="HelloWorld"><br />
<wsdl:input message="tns:HelloWorldSoapIn" /><br />
<wsdl:output message="tns:HelloWorldSoapOut" /><br />
</wsdl:operation><br />
<wsdl:operation name="registerCompany"><br />
<wsdl:input message="tns:registerCompanySoapIn" /><br />
<wsdl:output message="tns:registerCompanySoapOut" /><br />
</wsdl:operation><br />
<wsdl:operation name="getCompanyId"><br />
<wsdl:input message="tns:getCompanyIdSoapIn" /><br />
<wsdl:output message="tns:getCompanyIdSoapOut" /><br />
</wsdl:operation><br />
<wsdl:operation name="removeCompany"><br />
<wsdl:input message="tns:removeCompanySoapIn" /><br />
<wsdl:output message="tns:removeCompanySoapOut" /><br />
</wsdl:operation><br />
<wsdl:operation name="updateGame"><br />
<wsdl:input message="tns:updateGameSoapIn" /><br />
<wsdl:output message="tns:updateGameSoapOut" /><br />
</wsdl:operation><br />
<wsdl:operation name="removeGame"><br />
<wsdl:input message="tns:removeGameSoapIn" /><br />
<wsdl:output message="tns:removeGameSoapOut" /><br />
</wsdl:operation><br />
<wsdl:operation name="getCompanyGames"><br />
<wsdl:input message="tns:getCompanyGamesSoapIn" /><br />
<wsdl:output message="tns:getCompanyGamesSoapOut" /><br />
</wsdl:operation><br />
<wsdl:operation name="getIdByGameName"><br />
<wsdl:input message="tns:getIdByGameNameSoapIn" /><br />
<wsdl:output message="tns:getIdByGameNameSoapOut" /><br />
</wsdl:operation><br />
</wsdl:portType><br />
<wsdl:binding name="companyServiceSoap" type="tns:companyServiceSoap"><br />
<soap:binding transport="http://schemas.xmlsoap.org/soap/http" /><br />
<wsdl:operation name="HelloWorld"><br />
<soap:operation soapAction="http://test.net/HelloWorld" style="document" /><br />
<wsdl:input><br />
<soap:body use="literal" /><br />
</wsdl:input><br />
<wsdl:output><br />
<soap:body use="literal" /><br />
</wsdl:output><br />
</wsdl:operation><br />
<wsdl:operation name="registerCompany"><br />
<soap:operation soapAction="http://test.net/registerCompany" style="document" /><br />
<wsdl:input><br />
<soap:body use="literal" /><br />
</wsdl:input><br />
<wsdl:output><br />
<soap:body use="literal" /><br />
</wsdl:output><br />
</wsdl:operation><br />
<wsdl:operation name="getCompanyId"><br />
<soap:operation soapAction="http://test.net/getCompanyId" style="document" /><br />
<wsdl:input><br />
<soap:body use="literal" /><br />
</wsdl:input><br />
<wsdl:output><br />
<soap:body use="literal" /><br />
</wsdl:output><br />
</wsdl:operation><br />
<wsdl:operation name="removeCompany"><br />
<soap:operation soapAction="http://test.net/removeCompany" style="document" /><br />
<wsdl:input><br />
<soap:body use="literal" /><br />
</wsdl:input><br />
<wsdl:output><br />
<soap:body use="literal" /><br />
</wsdl:output><br />
</wsdl:operation><br />
<wsdl:operation name="updateGame"><br />
<soap:operation soapAction="http://test.net/updateGame" style="document" /><br />
<wsdl:input><br />
<soap:body use="literal" /><br />
</wsdl:input><br />
<wsdl:output><br />
<soap:body use="literal" /><br />
</wsdl:output><br />
</wsdl:operation><br />
<wsdl:operation name="removeGame"><br />
<soap:operation soapAction="http://test.net/removeGame" style="document" /><br />
<wsdl:input><br />
<soap:body use="literal" /><br />
</wsdl:input><br />
<wsdl:output><br />
<soap:body use="literal" /><br />
</wsdl:output><br />
</wsdl:operation><br />
<wsdl:operation name="getCompanyGames"><br />
<soap:operation soapAction="http://test.net/getCompanyGames" style="document" /><br />
<wsdl:input><br />
<soap:body use="literal" /><br />
</wsdl:input><br />
<wsdl:output><br />
<soap:body use="literal" /><br />
</wsdl:output><br />
</wsdl:operation><br />
<wsdl:operation name="getIdByGameName"><br />
<soap:operation soapAction="http://test.net/getIdByGameName" style="document" /><br />
<wsdl:input><br />
<soap:body use="literal" /><br />
</wsdl:input><br />
<wsdl:output><br />
<soap:body use="literal" /><br />
</wsdl:output><br />
</wsdl:operation><br />
</wsdl:binding><br />
<wsdl:binding name="companyServiceSoap12" type="tns:companyServiceSoap"><br />
<soap12:binding transport="http://schemas.xmlsoap.org/soap/http" /><br />
<wsdl:operation name="HelloWorld"><br />
<soap12:operation soapAction="http://test.net/HelloWorld" style="document" /><br />
<wsdl:input><br />
<soap12:body use="literal" /><br />
</wsdl:input><br />
<wsdl:output><br />
<soap12:body use="literal" /><br />
</wsdl:output><br />
</wsdl:operation><br />
<wsdl:operation name="registerCompany"><br />
<soap12:operation soapAction="http://test.net/registerCompany" style="document" /><br />
<wsdl:input><br />
<soap12:body use="literal" /><br />
</wsdl:input><br />
<wsdl:output><br />
<soap12:body use="literal" /><br />
</wsdl:output><br />
</wsdl:operation><br />
<wsdl:operation name="getCompanyId"><br />
<soap12:operation soapAction="http://test.net/getCompanyId" style="document" /><br />
<wsdl:input><br />
<soap12:body use="literal" /><br />
</wsdl:input><br />
<wsdl:output><br />
<soap12:body use="literal" /><br />
</wsdl:output><br />
</wsdl:operation><br />
<wsdl:operation name="removeCompany"><br />
<soap12:operation soapAction="http://test.net/removeCompany" style="document" /><br />
<wsdl:input><br />
<soap12:body use="literal" /><br />
</wsdl:input><br />
<wsdl:output><br />
<soap12:body use="literal" /><br />
</wsdl:output><br />
</wsdl:operation><br />
<wsdl:operation name="updateGame"><br />
<soap12:operation soapAction="http://test.net/updateGame" style="document" /><br />
<wsdl:input><br />
<soap12:body use="literal" /><br />
</wsdl:input><br />
<wsdl:output><br />
<soap12:body use="literal" /><br />
</wsdl:output><br />
</wsdl:operation><br />
<wsdl:operation name="removeGame"><br />
<soap12:operation soapAction="http://test.net/removeGame" style="document" /><br />
<wsdl:input><br />
<soap12:body use="literal" /><br />
</wsdl:input><br />
<wsdl:output><br />
<soap12:body use="literal" /><br />
</wsdl:output><br />
</wsdl:operation><br />
<wsdl:operation name="getCompanyGames"><br />
<soap12:operation soapAction="http://test.net/getCompanyGames" style="document" /><br />
<wsdl:input><br />
<soap12:body use="literal" /><br />
</wsdl:input><br />
<wsdl:output><br />
<soap12:body use="literal" /><br />
</wsdl:output><br />
</wsdl:operation><br />
<wsdl:operation name="getIdByGameName"><br />
<soap12:operation soapAction="http://test.net/getIdByGameName" style="document" /><br />
<wsdl:input><br />
<soap12:body use="literal" /><br />
</wsdl:input><br />
<wsdl:output><br />
<soap12:body use="literal" /><br />
</wsdl:output><br />
</wsdl:operation><br />
</wsdl:binding><br />
<wsdl:service name="companyService"><br />
<wsdl:port name="companyServiceSoap" binding="tns:companyServiceSoap"><br />
<soap:address location="http://localhost:1705/com/company/webservices/companyService.asmx" /><br />
</wsdl:port><br />
<wsdl:port name="companyServiceSoap12" binding="tns:companyServiceSoap12"><br />
<soap12:address location="http://localhost:1705/com/company/webservices/companyService.asmx" /><br />
</wsdl:port><br />
</wsdl:service><br />
</wsdl:definitions>
My ide is that the the correct data is set from the client to the webservice but that the namespce may be wrong and by that it take the gameName as null??
|
|
|
|
|
Hi, I'm working tidying up (and getting rid of) heaps of word documents we have in countless folders that have guidlines, documentation and so on. To do this I've created a searchable knowledge base. What I want to be able to do (for the short term) is take attached word docs, read the content and insert the text. Later on i might look at doing clever things with images and so on but this will do for now.
currently, I can do this when reading a local file using the code below:
<br />
string DocToHtml(string docPath)<br />
{<br />
Microsoft.Office.Interop.Word.Application app=new Microsoft.Office.Interop.Word.Application();<br />
app.Visible=false;<br />
Object o=Missing.Value;<br />
object docFile=docPath;<br />
_Document doc=app.Documents.Open(ref docFile,ref o,ref o,ref o,ref o,ref o,ref o,ref o,ref o,ref o,ref o,ref o,ref o,ref o,ref o,ref o);<br />
<br />
returnString=doc.Content.Text.ToString(); <br />
<br />
object t=true;<br />
app.Quit(ref t,ref o,ref o);<br />
<br />
return returnString;<br />
}<br />
That works as a tester, it just dumps the text into a string. fine by me for now. Next bit though, that is the bit I am having trouble with, is taking binary data from a database and using it in the same way as the _document doc etc bit above. I can load the data as a datareader;
SqlDataReader dr = command.ExecuteReader(); - gets me the data.
but don't know what to do with it then.
Any suggestions please?
Thanks!
Kuba
|
|
|
|
|
byte[] bdata = dr.getBytes(......); // fill all the parameters
//storing as a doc file
FileStream fs = new FileStream(Server.MapPath("a.doc"),FileMode.Create);
BinaryWriter bw = new BinaryWriter(fs);
bw.Write(bdata);
fs.Close();
//end
now your data is in file a.doc
do your code in a.doc
Regards,
Sylvester G
sylvester_g_m@yahoo.com
|
|
|
|
|
great thanks, works fine.
I used bw.Write((byte[]) dr["data"]); instead, made it a bit simpler!
|
|
|
|
|
How can i get the cpu\graphics accelerator temperature? and how can i get the fan speed?
is there a class to do so? or an API?
|
|
|
|
|
This type of information is available in the WMI[^] classes. Most of what you want would be in the Win32_xxx classes.
Using WMI from managed code is not well documented (IMHO) but it is possible.
-----------------------------
In just two days, tomorrow will be yesterday.
|
|
|
|
|
My usercontrol implement a interface IUIItem ,the interface has a method : IUIItem GetControl()
{ return this;}
But when the method is called repeatedly ,the GDI alway increase. I don't know where is the problem. Is there somebody can help me?
rockinfog
-- modified at 7:56 Monday 12th March, 2007
|
|
|
|
|
Hi
Well i am trying to Dial my ISP using internal Modem...
can anyone give me some help in this regard.
1- If i want to use my Windows DialUp Connection Account...
2- if i want to dial modem directly through application...
Please refer wat method of above two will be most suitable and achieveable.
kindly refer any Code.
Regards,
SAEED.
|
|
|
|