Several how-to questions


Author
Message
Daniel Essin
Daniel Essin
StrataFrame User (339 reputation)StrataFrame User (339 reputation)StrataFrame User (339 reputation)StrataFrame User (339 reputation)StrataFrame User (339 reputation)StrataFrame User (339 reputation)StrataFrame User (339 reputation)StrataFrame User (339 reputation)StrataFrame User (339 reputation)
Group: Forum Members
Posts: 235, Visits: 309
1 - If I have existing stored procs in a database, how can I make the deployment toolkit aware of them? They don't show up during database import.



2 - If I have existing views in a database, how can I make the deployment toolkit aware of them? They don't show up during database import.



3 - I have a bo with a property called PrimaryKeyField. The value is "A class derived from MicroFour.StrataFrame.Business.BusinessLayer must override the property 'PrimaryKeyField'". There is a property in the BO called PrimaryKeyFields. What's going on here?



4 - I have a bo to retrieve a user row after login. If I log in with an incorrect password, no application exception is thrown but if I inspect the bo, it throws an internal exception on each of the fields. I'm confused. The code is:



private static void ShowLoginAndInitMainForm(ShowLoginAndInitFormEventArgs e)

{

FormLogin fl = new FormLogin();

if (fl.ShowDialog() == DialogResult.OK)

{

string conn;

Hashtable cfg = (Hashtable)ConfigurationManager.GetSection("database");

conn = "server=" + cfg["server"] + ";initial catalog=" + cfg["initialCatalog"] + ";uid=" + fl.UserName + ";pwd=" + fl.Password + ";";

DataLayer.DataSources.Add(new SqlDataSourceItem("", conn));

ConnectionManager.SetConnections();

BoUsers user = new BoUsers();

user.GetUserInfo(fl.UserName);

e.LoginSuccessful = true;

}

}





   public void GetUserInfo(string UserCode)

{

SqlCommand cmd = new SqlCommand();

cmd.CommandText = "SELECT * FROM SvcUsers WHERE LogonName = '" + UserCode + "'";

FillDataTable(cmd);

}





Replies
StrataFrame Team
S
StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)
Group: StrataFrame Developers
Posts: 3K, Visits: 2.5K
My pleasure on the timeout issue... keep me updated on your other problem.
Daniel Essin
Daniel Essin
StrataFrame User (339 reputation)StrataFrame User (339 reputation)StrataFrame User (339 reputation)StrataFrame User (339 reputation)StrataFrame User (339 reputation)StrataFrame User (339 reputation)StrataFrame User (339 reputation)StrataFrame User (339 reputation)StrataFrame User (339 reputation)
Group: Forum Members
Posts: 235, Visits: 309
OK - I've done the following



- Compiled the source.

- Installed the new binaries in the GAC (since it wouldn't let me delete the existing ones).

- Examined the source. The PrimaryKeyField property of the BusinessLayer does not contain any code that would throw a not implemented exception.

- The PropertyGrid for my BO still containes "A class derived from MicroFour.StrataFrame.Business.BusinessLayer must override the property 'PrimaryKeyField'" in the PrimaryKeyField slot.



I then copied all of the source directories and included them in my solution. I set the references to the projects rather than to the assemblies in the GAC or the Assemblies in the StrataFrame directory. Everything builds without errors BUT the "A class derived from MicroFour.StrataFrame.Business.BusinessLayer must override the property 'PrimaryKeyField'" message is still there.



I have grepped all of the source files for "A class derived from .+ must override". It appears in 5 locations but not in PrimaryKeyField.



I'm sorry but I have no clue as to wha't going on here.
StrataFrame Team
S
StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)
Group: StrataFrame Developers
Posts: 3K, Visits: 2.5K
Where are you getting that error message?  Within the property sheet at design time? 

I never understood where you were getting that message.  Now it makes more sense. 

When you go to the component designer for a business object, Visual Studio creates a instance of the object in memory for you work with.  However, in the designer, it doesn't create an instance of your class, but rather the base class for your class (which happens to be BusinessLayer).  So, Visual Studio actually creates an instance of BusinessLayer rather than an instance of your class, and that instance of BusinessLayer is what gets shown within the property sheet. 

Now, whenever we added the PrimaryKeyFields property, I essentiall renamed the PrimaryKeyField property to PrimaryKeyFields and wrote a new PrimaryKeyField property.  So, the code within the PrimaryKeyFields property was the code that was throwing the NotImplementedException.  This is the proper behavior since the object placed in the property sheet is an instance of BusinessLayer rather than your class.  The reason you're getting that message is that I forgot to place the [Browsable(false)] attribute on the PrimaryKeyField property when I created it.  I've fixed it, and it won't show up in the property sheet in future versions. 

So, the message won't cause any runtime problems since you create instances of your classes rather than BusinessLayer.

Daniel Essin
Daniel Essin
StrataFrame User (339 reputation)StrataFrame User (339 reputation)StrataFrame User (339 reputation)StrataFrame User (339 reputation)StrataFrame User (339 reputation)StrataFrame User (339 reputation)StrataFrame User (339 reputation)StrataFrame User (339 reputation)StrataFrame User (339 reputation)
Group: Forum Members
Posts: 235, Visits: 309
Thanks. That makes sense.
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Threaded View
Threaded View
Daniel Essin - 19 Years Ago
StrataFrame Team - 19 Years Ago
Daniel Essin - 19 Years Ago
StrataFrame Team - 19 Years Ago
Daniel Essin - 19 Years Ago
                         My pleasure on the timeout issue... keep me updated on your other...
StrataFrame Team - 19 Years Ago
                             OK - I've done the following

- Compiled the source.
-...
Daniel Essin - 19 Years Ago
                                 Where are you getting that error message? Within the property sheet at...
StrataFrame Team - 19 Years Ago
                                     Thanks. That makes sense.
Daniel Essin - 19 Years Ago

Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search