|
The schema that you get is relative to the result set. If you want to have a specific schema that matches your tables, I suggest you create a typed DataSet by using either the xsd.exe utility that ships with the .NET Framework SDK to create a typed DataSet class from an XML Schema, or add a new DataSet class in Visual Studio .NET and either re-create your tables (and optionally your keys and relationships), or drag and drop your tables from the Server Explorer after adding a connection object to your database.
Use that typed DataSet in your OdbcDataAdapter calls (like Fill ) and in your queries. If you're using the designer in VS.NET for a DataGrid or some other data-bound control, it gives you nice design-time support for specific table names and columns. If also provides faster access to data when using the typed table and column names because they reference the DataTable and DataColumn objects directly, instead of using a string name that requires several looks ups.
If you don't want to use a typed DataSet , you can also add a columns to your TableMapping property. See the DataTableMapping class and its ColumnMappings property documentation in the .NET Framework SDK for more information.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
I got it working with a typed DataSet ... thanks very much for your help Heath!!! You're the best!
Regards, mYkel
|
|
|
|
|
Hello guys!
I've seen the samples here and I have a few questions:
1 - Is it possible to download the messages with a component and onde they are downloaded I
can't download with outlook?
2 - Can I save the messages in a archive like a pst?
Greetings,
Agus
|
|
|
|
|
|
Hello,
I would like to use the NUnit Framework on GUIs.
Currently I´m using an instance of my form to get all controls. I am then filling some textboxes and push some buttons and 'assert' for errors. But this isn´t working anymore as soon as a modal dialog pops up.
Are there any tools for .NET to do this (like Abbot for JUnit)?
|
|
|
|
|
Simple: How can i use windows API in C#
|
|
|
|
|
Simple: Declare the functions using System.Runtime.InteropServices.DllImportAttribute.
[DllImport("user32.dll")]
private static extern IntPtr GetDC(IntPtr hWnd);
|
|
|
|
|
Hi
I have a problem with type casting . I have the string which is the name of one control(HtmlTable) . I know the control I want to type cast the name as the control.
I tried the following and I get "Invalid Casting ! "
string TableName = "Table1";
(HtmlTable)(TableName)
and
(HtmlTable)((object)(TableName))
Thanks
|
|
|
|
|
Do you know the container of the control? Then you can find the name in the Controls colleciton:
HtmlTable myTable = null;
foreach(Control ctl in container.Controls){
if(ctl.Name == tableName){
myTable = (HtmlTable)ctl;
break;
}
}
If you don't know, where the control is, you can find it "by name":
String tableName = "Table1";
Object ctl = null;
System.Reflection.FieldInfo info = this.GetType().GetField(tableName);
if(info != null){
ctl = info.GetValue(this);
}
HtmlTable myTable = (HtmlTable)ctl;
|
|
|
|
|
Or by referencing the container control, you can use FindControl , passing the name. Cast the return (after checking for null ) to an HtmlTable then.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
thanks that really helped
|
|
|
|
|
How can i convert an xml file to html file. Actually i want to provide the xml file and xsl file to the function and it will give me a file with .htm or .html extension.
Thanx in advance
Regards
minamkhan
Inam
|
|
|
|
|
Take a look at this example:
http://www.csharpfriends.com/Articles/getArticle.aspx?articleID=64
M tti s
|
|
|
|
|
|
|
I don't quite understand what dispose method exacly does. From manual I read that it "frees up ny ressources being used". But what happens to the object after calling dispose method ? Is it destroyer ? Also - is there any link between an object's destructor and dispose method ?
Regards, Desmond
|
|
|
|
|
|
IDisposable.Dispose (you must implement IDisposable for this to be used correctly) is best used to free native resources (since many classes in .NET use native HANDLE s). You can also use it to dispose child objects and set references to null .
This is not a destructor, though. In fact, many times when the Dispose method cleans-up the resources, it will tell the GC to not call the destructor since there's nothing left to do (be sure you clean-up all resources before doing so, though):
public void Dispose()
{
GC.SuppressFinalize(this);
} For a more thorough example, see the documentation for the GC.SuppressFinalize method in the .NET Framework SDK.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
there is a Garbage Colection 101 article on CodeProject here[^]
-------------------------------
Joan
MomComputerGeek.com
|
|
|
|
|
Hi,
I have two panels side by side.
In runtime, I am adding dyanmic controls to both of panels.
(control label A is insert to Panel1 and Panel2.)
Suppose I insert 50 Labels to both panels. If I move the scroll bar of Panel1, I also want to move the scroll bar of Panel 2 at the same time. How can I do that?
Please show me the way how to do that. I try to use SendMessage Method, but I do not success.
Regards,
|
|
|
|
|
|
Hi Matthew Hazlett
Thank you for your article. After study your articles, I port that code to C#. now I done the scrolling case between two pannels. But I face the other problems. when I put the autoscroll properties "true", I got the autoscroll panel. But I don't want to see auto scroll panel in Panel A. How do I do that? I mean I want to get the same as "Excel". Line Number panel has no "auto scroll".
Thank you for your input.
Regards,
|
|
|
|
|
I am trying to find a way to read the text out of a PDF file as a search facility. This is a requirement that a client has asked me to quote on. My application is written in C#.
I am having a lot of difficulty trying to find any examples or even .NET components that I could purchase to do this task.
This application will be running on a server with very limited permissions. I have no ability to install standard COM components.
Hope someone can help.
Enjoy
Craig
|
|
|
|
|
PDF'S wern't really made for people to be able to rip text contents. However I did see somthing for .NET and PDF'S that I "think" can read them. I am not sure I never tested this out but just remember the link.
http://sourceforge.net/projects/pdflibrary/[^]
The project is now defunct but maybe you can use some of the code.
Hope this helps
Matthew Hazlett
Windows 2000/2003 MCSE
Never got an MCSD, go figure...
|
|
|
|
|
Thanks for your help.
I looked into that product, which was stopped at a very green age. There is also itextsharp.sourceforge.net[^] which seems to be extensive in its generation ability but specifically points out the same as you have, that PDF's aren't made to rip text.
So the solution I have found that works for me is that Adobe has a filter for Microsofts indexing server that allows for searching through PDF files. See http://www.adobe.com/support/salesdocs/1043a.htm[^] for more information. I can use Chris Mauders article on using indexing server as a search facility to code the rest.
Enjoy
Craig
|
|
|
|