|
Thanks! I found it very useful. But I have another problem regarding this DataView.
Is it possible for the data after filtered in view.RowFilter to be stored inside a new dataTable ? Thanks!;)
Regards,
Kuan Wai Mun
|
|
|
|
|
Hello Gurus,
I just notice myself that it seems like DataGrid has no scrollbars. Did I miss something? How can I some how add scrollbars to DataGrid? Or is there an altenative control? If you have any information about this, I greatly appreciate.
Thanks a $million to you,
Khang Nguyen
|
|
|
|
|
the datagrid should have scrollbars if they are needed. Try putting info into a bunch of rows and see if they show up after you get past the end of the control.
- D
|
|
|
|
|
myDataView contains 1,204 rows.
// I set
myDataGrid.DataSource = myDataView;
At run-time, I got HScrollBar for myDataGrid with a little problem (can't see the last data column). But, I don't see the VScrollBar even though I have that many rows. I wonder if I have to use DataTable, instead of DataView, as something like this:
myDataGrid.DataSource = myDataTable;
Thanks,
Khang
|
|
|
|
|
Hy everyone!
I do want to add a webservice via https, because in the MSDN it says if I do so, my programm will talk via SSL to the webservice. Well our webservice is a Java Webserver and the webservice itself was created via the wsdl file, meaning I do access the wsdl for adding the web reference.
But doing so it says "connection to remote server was closed" and I do get a "403 Forbidden" error code.
Well I would have understood this error message if I couldn't reach the webservice, but there is something very strange: I am able to display the WSDL file via the Internet Explorer and via the wizard window in Visual Studio. But in the upper right window it displays the error messages and the "Add reference" button is grayed out. So I can't add the reference. It worked well via http, but it does not work via the https.
The only difference between these are the way we do access the webservice. Via http it looks like this:
http://ip:8080/servicedirectory/service?WSDL
via https it looks like this
https://ip:8443/servicedirectory/service?WSDL
where ip is the IP of the server containing the webservice, servicedirectory is the path to the webservice and service is the name of the webservice (well I know a very strange way to call a webservice service ).
But well I did what it said in the MSDN article but we were not able to fix the problem. We also had a look in the webloggs but there was nothing strange in there. Well I have to add the server is a tomcat server, but I think this shouldn't matter.
So if anyone of you has a solution to our tricky problem, please let us know, because well, we also thought about the certificate being necessary to being add to the reference, but the reference is just a kind of "symbolic link" to the service and it doesn't start it, it only creates the proxy class, does it?
Thanks!
Stephan.
|
|
|
|
|
You can use an HTTPS schema. If you're having problems generating the proxy class from the WSDL over HTTPS, do it using HTTP and in your code change the Url property of the web service proxy (a derivative of the WebClientProtocol class which defines the Url property) to your HTTPS schema. If the HTTPS virtual server requires a client certificate to connect via SSL, then make sure you add your X509Certificate to the ClientCertificates property, which is defined by the HttpWebClientProtocol (a derivative of WebClientProtocol and the actual base class for your web service proxy over HTTP/S).
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Well, I did this, changing the Url from http to https.
But when I started invoking methods of the service this caused an exception together with the same error message like before
(The underlying connection was closed: Unable to connect to the remote server.
The remote server returned an error: (403) Forbidden.)
This means I am able to force https in the wsdl and the service proxy but then it thorws the exception when being invoked.
We have also tried to send a client certificate but my colleage didn't implement any requirement for a client certificate, meaning I should be able to use the service without a certificate.
The server just sends the certificate to encrypt the data being send with the servers public key.
Or did I missinterprete the definition of "virtual server"? Or do I need a certificate even if the server class he created didn't ask for one?
Stephan.
|
|
|
|
|
Unfortunately, I really don't know what you tell you. Using HttpWebRequest for an HTTPS connection is seamless (well, except for you in this case ). You should try writing a simple app that just downloads the content from any given URL and try connecting to a few other sites that implement HTTPS just to see if it's not something with your installation (although I can't imagine what that'd be).
Sorry I can't be of more help, but this should work and the fact that it works if you use IE or something else just compounds the problem.
Good luck!
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
I'm trying to sort the data in my table, but no matter what I do with the Sort property, the resultant data does not change it's order at all. Does anyone know what I'm missing ? The authors of MSDN apparently missed it too, if there's a step I need to take...
DataSet comparisonDocs = facade.CompareMetadata(objectVids, elementPaths);<br />
DataView compSort = new DataView(comparisonDocs.Tables[0]); <br />
compSort.Sort="Title, Version/Major DESC, Version/Minor DESC";<br />
comparisonRepeater.DataSource = compSort;<br />
comparisonRepeater.DataBind();
Christian
I have drunk the cool-aid and found it wan and bitter. - Chris Maunder
|
|
|
|
|
Is Version/Major supposed to be a field name? If so, try [Version/Major] . If you mean the Major field from the Version table, use . instead of / , although I'm not sure how that'd work in this case since your DataView is over a specific DataTable . If Version is a related table (and a DataRelation is established between the two), then use Child(RelationshipName).FieldName which should work.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Version/Major is indeed a field name. I didn't know that / was reserved in SQL, but I initially sorted by Title only, so I'm not sure that the [] is going to help ( it didn't sort by Title when I just specified 'Title' as the order by before ). Also, when I got the name wrong ( I'm not responsible for the schema ), and just put VersionMajor, it blew up on the basis that the column did not exist, so it presumably can see that Version/Major is a column name the way the code stands.
Have you used the sort property before ? It's supposed to work just the way that I'm trying to use it, isn't it ?
Christian
I have drunk the cool-aid and found it wan and bitter. - Chris Maunder
|
|
|
|
|
try:
DataView compSort = comparisonDocs.Tables[0].DefaultView;
|
|
|
|
|
Thanks, I did that. It turned out the sort was working, but the way the old code ( which I didn't write ) got it's details to render involved an array of objects instead of the data in the table...
Christian
I have drunk the cool-aid and found it wan and bitter. - Chris Maunder
|
|
|
|
|
Glad to see you got it working. I had a reply sitting at work that I couldn't submit because the site wasn't working ("The resource is in use").
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Why don't you try prefixing the field with the table name followed by a period.
[EDIT]
Just read you got it working, sorry, I should read through everything before posting!
[/EDIT]
- Nick Parker My Blog | My Articles
|
|
|
|
|
I've been developing a project using VS.NET 2003 for well over a year. Today I'm building the installer (Setup.msi), and when I test it out, I get the usual "Preparing to install files" (or whatever) message box, and then I get a message box that says "<error message="">".
I haven't changed that much in my solution lately. I had recently installed the .NET bootstrapper plug-in, but even after uninstalling that, I still get that when I build installers.
Any ideas or tips? Any ways I can effectively debug the MSI or get some verbose logging?
Thanks,
Arun
|
|
|
|
|
If you read the Command-line Options[^] for Windows Installer, you could construct the following command-line for verbose logging:
msiexec.exe /I Setup.msi /L*uv Setup.log Typically, find the first error reported (although sometimes errors occur that aren't vital for the installation to continue, so ignore those).
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Thanks!
Turns out it was an invalid (empty) launch condition that lingered around instead of being deleted.
|
|
|
|
|
I have a MDI application in which one of the child windows opens a modal dialog. If the focus is switched off the MDI app to some other open app, Windows seems to loose track of the MDI app (can't alt-tab to it, etc.) until focus is restored to the dialog by clicking on it. But every time focus is shifted, the MDI form is set as the focus and not the modal dialog. How do I prevent Windows from seemingly losing track of my app? I have added code to the MDI form's Container Activated event which gets around this problem seems like a very convoluted way to solve the problem.
Thanks in advance
~ D
|
|
|
|
|
Hi!
I want to make an Excel 2003 Add-in in C# that, when is loaded by the user, it opens a Form.
I have searched in several sites and until now I only found how to make add-ins that are automatically loaded when Excel starts.
Does anybody can help me?
Thanks!
Paulo
|
|
|
|
|
You should start by reading the content in the Microsoft Visual C# Developer Center[^] for the Office 2003 System. This includes many, many articles and other topics about add-ins and other enhancements to Office using .NET.
The basic idea is that both Office and Visual Studio utilize a DTE (design-time environment) that is very extensible, but you must read the documentation to know how to do it. There are many articles if you look in the right place, and that link above is the best place to start.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Hi all,
I am getting the following error when trying to update database table:
"Error: Update unable to find TableMapping['Table'] or DataTable 'Table'.
Here is the code snippet that is throwing the error (specifically, the Update() command )
if (upDateFlag)
{
//update
SqlConnection dataConnection = new SqlConnection("Integrated Security=true;" +
"Initial Catalog=SPIRIT2TEST;" + "DataSource=TECHSERVER") ;
SqlDataAdapter adap = new SqlDataAdapter("SELECT * FROM Dept", dataConnection);
adap.Update(changedDataDs, "Dept");
ds.AcceptChanges();
}
catch (Exception e)
{}
Can you please point out what I might be doing wrong...
Thanks
|
|
|
|
|
According to this snippet, you have no SqlDataAdapter.UpdateCommand , InsertCommand , or DeleteCommand . How do you expect the SqlDataAdapter.Update call to update the database based on the connection and changes in changedDataDs ? You need to either assign the appropriate SQL statements with the properties I mentioned above, or use a SqlCommandBuilder when you specify the fields (instead of an asterisk in your SELECT statement).
Also, you don't need to call DataSet.AcceptChanges after calling SqlDataAdapter.Update , since Update calls AcceptChanges for you.
Finally, just because your SELECT statement includes "Dept" for a table doesn't mean that changedDataDs does. This is most likely the source of your exception, though even if it did contain the "Dept" table the lack of UPDATE, INSERT (typically separated by a semi-colon along with a SELECT to make sure auto-assigned fields are filled-in correctly), and DELETE commands would also throw an exception.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
In a winapp i embed a web browser control and a richtextbox control,for one way i use :"richTextBox1.Text=((mshtml.HTMLDocument)axWebBrowser1.Document).documentElement.innerHTML " to get html file to richtextbox, after modify this content ,how can i get it to mshtml?
|
|
|
|
|
Cast AxWebBrowser.Document to UCOMIPersistFile (a COM interface declared in .NET in the System.Runtime.InteropServices namespace; casting a COM-imported interface performs a QueryInterface for it) and use the Load method:
richTextBox1.SaveFile("temp.html",
RichTextBoxStreamType.UnicodePlainText);
UCOMIPersistFile file = (UCOMIPersistFile)axWebBrowser1.Document;
file.Load("temp.html");
Microsoft MVP, Visual C#
My Articles
|
|
|
|