So what's the question? The Microsoft Jet provider for .mdb files doesn't support retrieving parameters from stored procedures, which really are only module functions.
If you need a real RDBMS, look into the Microsoft Data Engine (MSDE) at http://www.microsoft.com/sql/msde/default.asp[^]. This is Microsoft SQL Server with a few limitations, like the number of concurrent connections supported (10). Other than that, it supports true stored procedures, triggers, tables and views (of course), functions, and everything else that SQL Server supports. It is also freely redistributable so long as you have a valid license for a product that includes the MSDE, like Visual Studio .NET, Microsoft Access (I think), an MSDN Subscription, and several others things. It's also a free download.
You can install up to 16 instances of the MSDE and SQL Server (think of them as the same thing). Microsoft Access even supports direct access and designing with the MSDE if you still want to design your databases using MS Access.
Basically, though, you get a real RDBMS that is much faster and supports everything any other RDBMS like Oracle and DB2 does. It also supports output parameters in stored procedures and has better support in .NET using the System.Data.SqlClient namespace, which is written specifically for SQL Server and you don't have to guess at what is supported. System.Data.OleDb is based on OLE DB and uses abstract OLE DB providers that must provide some basic functionality, but don't have to provide any of the optional stuff.
For instance, in an article I wrote I use the Microsoft Indexing Service OLE DB provider. It only supports basic SELECT statements and views using an OleDbCommand. Period. No updates, no insertions, no transactions, no stored procedures. You're left to the will of the OLE DB provider.
First of all, design your XML document to reflect alternatives which are more like siblings. Because you have a fragment like:
<!-- and the rest -- >
<!-- and the rest -- >
This implies that each item should be a separate row. This isn't absolute, but common. If you design your document like this, you could actually use DataSet.ReadXml and create a DataSet which is easily bindable to a CheckedListBox.
If you want to use your schema that you posted, you'll have to parse the XML document manually and create an IList or IListSource implementation. The easiest way would be to use an ArrayList, which implements IList. You can then use this object with the CheckedListBox.DataBindings property (if memory serves me correctly), or enumerate the list and add each item to the CheckedListBox.Items property. If you use the latter method, you can forego the ArrayList and just add the different XML elements to the CheckedListBox.Items property in the first place.
For information on multi-column CheckedListBoxes, see the CheckedListBox.MultiColumn property documentation, which inherits from the ListBox control class.
dophka wrote: I want to show the data in a datagrid, not a checkedlistBox.
Good, a DataGrid is easier to data-bind since you only have to use the DataSource property. You should also consider using the DataMember and TableStyles properties. See the SDK documentation for details or play around with the designer in VS.NET a little. It's not too difficult.
dophka wrote: I created a new dataset. how can I make dataset.ReadXml() read from a string?
You'll need to read the fragment as a TextReader unfortunately. Let's say your XML fragment is in a string variable named xml:
StringReader reader = null;
DataSet ds = null;
reader = new StringReader(xml);
ds = new DataSet("news");
if (reader != null) reader.Close();
I'm the kind of guy that would rather teach a man to fish than give him a fish. So, read the documentation for the DataGrid. You already have your DataSet, so you assign that to the DataGrid.DataSource property and set the DataGrid.DataMember property to the table name you want to bind to. Columns are automatically created for each column of that table, but you can control this with the DataGrid.TableStyles property.
Try doing all this in VS.NET using the designer. Create a new DataSet schema then use the Data toolbox to add a new DataSet object. Add a DataGrid to your form or control and play around with some of the properties. Reading the documentation will fill in the details, which are important to understand.
There are also many great articles on data-binding here on CodeProject. Just use the search box toward the top and use generic terms like "DataSet" or "DataGrid". I'm sure you'll find plenty.
Besides, going into any great deal really isn't meant for the forums. With all the possibilities, this is better discussed in an article. Always be sure to read the documentation, though. It should be your first stop for any questions.
dophka wrote: (something I didn't yet find in the properties)
Don't be a drag-n-drop programmer - read the documentation for the DataGrid You'll find a lot more is possible than what the properties provide (some properties are browsable in the designer, and then there's all the methods that you won't see...)
dophka wrote: when the grid comes out it has four columns as expected but how do I make them fill all the space horizontally?
This is perhaps the biggest problem with the DataGrid. There's really nothing you can do but resize the column programmatically. I'm sure I've seen a couple articles on this here on the CP site. Just try a search.
dophka wrote: when the text in a column does not fit the grid window horizontally, is there a way to make it put it into a new line? like excel does it?
First of all, you must understand that Excel is a spreadsheet control - not a grid (just so you don't get any other crazy ieas in your head! )
Second, you can create a custom DataGridColumnStyle class that allows you to edit text in multiple lines, but the display of the values is dependent on the DataGrid. To my knowledge, there is no way to get the text to display in multiple lines when not in edit mode.
If i run this program for the first time in Visual Studio there is an error saying CDO.Message is not accessible.
When it runs all the mail messages are stored in c:\inetpub\mailroot\queue
they do not reach there destinatin. They all are stored in my computer only.
Please someone tell me how to solve this.
WIll be eagrly waiting for the answer.
Can you post the details of how you're setting up myemail? Make sure the From property is set. Also, use a try/catch block to capture the exception and look for InnerExceptions. An InnerException may give more details as to the nature of the problem.
This isn't his problem. As Mazdak said, we answer his question several days ago. His problem is that he hasn't configured the SMTP Virtual Server in the Internet Information Manager. I gave him pointers how to get started and told him to read the help, but he obviously hasn't.
Once again I'll tell you that you're code isn't the problem - the problem is that you have NOT configured the SMTP Virtual Server at all or correctly. Again, go to Internet Information Manager in your Administrative Tools folder in the Control Panel and find the SMTP Virtual Server. You have to configure this to send mail using SMTP. It isn't setup by default but there's very little to do. Just read the help files which should be easy to understand.
Once again - as Mazdak also said - this is not a problem with your code, hence quit posting it in the C# forum. It is a problem with your machine configuration of the SMTP Virtual Server. If you need additional help, go to http://support.microsoft.com[^]. It really isn't hard to configure, though.
Hello again guys.
I have a new problem.
I made a button, which was had a keypress event and it worked perfectly.
Now I've a panel and it hasn't keypress event among its public stuffz.
How can i add my keypresseventhandler function to this panel?