Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to use BO generator with console app
Message
De
26/09/2008 18:39:28
Timothy Bryan
Sharpline Consultants
Conroe, Texas, États-Unis
 
 
À
26/09/2008 17:57:15
Information générale
Forum:
ASP.NET
Catégorie:
The Mere Mortals .NET Framework
Versions des environnements
Environment:
C# 3.0
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
MS SQL Server
Divers
Thread ID:
01351138
Message ID:
01351188
Vues:
15
>Thanks for your quick reply.
>
>Yes, I have went through a few of the jumpstarts. However, none of them describe the process of just having a console app as the consumer of one or more business entity objects. The jumpstarts begin by having you use one of the MM.Net project templates. It seems that the templates hook up some code behind the scenes that allows the seamless connection. However, I don't want to use the MM.Net project templates. I would just like to create my own console app or web application project app, but use the MM.Net business objects. Is this possible?

I just tested this and it works although like I said, you don't get everything the framework offers but you can get data. I created a business object project just like the jump start shows and added a public method public DataSet GetMyCustomers(); Don't forget to change the connection info in the app.config file and set the databaseKey in aBusinessObject.

Then I created a console app solution and added the existing business object project to the solution. You need to add a reference to the business object project to your app.
using System;
using System.Data;
using System.Text;

using BTS.ConsoleTest.Business;

namespace ConsoleApp
{
     class Program
     {
          static void Main(string[] args)
          {
               Customers oCustomer = new Customers();
               DataSet dsCust = oCustomer.GetMyCustomers();
               // Do Something with this here.
          }
     }
}
Tim
Timothy Bryan
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform