|
Nope. You'd be going through the same problem just to get a snapshot of the form. You'd also have to wait until the thing draw the REAL form to get usable controls.
If you're only using a few controls and pics, then what's taking so long? Perhaps a code profile would be in order.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I am trying to access a field of a strongly typed dataset (i.e. .xsd)
When I compile, it says: FirstNameColumn inaccessible due to it's protection level.
Where do I check this access level please?
Thanks
|
|
|
|
|
Hello,
I have managed to create an n-tier application which is structured as follows:
1) The database holds the data and contains the stored procedures
2) The datalayer calls the database and retrieves the data as DataSets
3) The WebService calls the datalayer and retrieves the data as DataSets
4) The Business layer calls the web service
5) The user interface which is a windows form, gets the data as datasets from the business and presents it in a DataGrid.
My intention is now to use strongly Typed DataSets i.e. .XSD files in the DataLayer and then use that dataset in the front end eventually.
My question is:
Is it possible to have a strongly typed DataSet in this datalayer or do I have to reference the datalayer from the client using add references. Hope you follow what I mean.
Thanks
|
|
|
|
|
What I'm trying to do is set up a system that can read records from a database and build a form according to the information contained in those records.
I've largely succeeded, but I'm having difficulty setting up a way to set sub-properties.
For demonstration purposes, I will use a concrete example. Let's say I'm trying to set up a label. I want to use database records to set the label's properties. One of the properties I want to set is Font. In the case of Font, there are subproperties, i.e. Bold, Italic, Name, Size, etc. In my example, I want the font to be bold, which means I need to set the Font.Bold subproperty to True.
I've pulled the applicable data from the database into a dataset called dsMyDataSet, set up as follows:
tblTemplateControls
ControlID | ControlType
1 | System.Web.UI.WebControls.Label
tblControlProperties
PropertyID | ControlID | PropertyName | PropertyValue | ParentPropertyID
1 | 1 | Font | NULL | 0
2 | 1 | Bold | True | 1
3 | 1 | Text | Hi, Mom! | 0
Here's the code I'm using:
<br />
for (int n = 0; n < this.dsMyDataSet.Tables["tblTemplateControls"].Rows.Count; n++)<br />
{<br />
dr = this.MyDataSet.Tables["tblTemplateControls"].Rows[n];<br />
<br />
Type myControlType = typeof(Control).Assembly.GetType((string)dr["ControlType"]);<br />
<br />
ConstructorInfo myControlContructor = myControlType.GetConstructor(System.Type.EmptyTypes);<br />
Control myControl = (Control)myControlContructor.Invoke(null);<br />
myControl.ID = Convert.ToString((int)dr["ControlID"]);<br />
<br />
DataRow[] Properties = this.dsMyDataSet.Tables["tblControlProperties"].Select("ControlID = " + myControl.ID);<br />
<br />
for (int j = 0; j < Properties.Length; j++)<br />
{<br />
DataRow Property = Properties[j];<br />
if ((int)Property["ParentPropertyID"] == 0)
{<br />
foreach (PropertyInfo pi in myControlType.GetProperties())<br />
{<br />
if (pi.Name == Property["PropertyName"].ToString().Trim())<br />
{<br />
MethodInfo mi = pi.GetSetMethod();<br />
<br />
string str = Property["PropertyValue"] is DBNull ? "" : Property["PropertyValue"].ToString().Trim();<br />
if (str != "")<br />
{<br />
mi.Invoke(myControl, new object[1] { Convert.ChangeType(str, pi.PropertyType) });<br />
}<br />
<br />
break;<br />
}<br />
}<br />
}<br />
<br />
else <br />
{<br />
DataRow[] ParentProperty = this.dsMyDataSet.Tables["tblControlProperties"].Select("ControlID = " + myControl.ID + " AND PropertyID = " + Property["ParentPropertyID"].ToString());<br />
foreach (PropertyInfo pi in myControlType.GetProperties())<br />
{<br />
if (pi.Name == ParentProperty[0]["PropertyName"].ToString().Trim())<br />
{<br />
MethodInfo mi = pi.GetSetMethod();<br />
<br />
Type myPropertyType = typeof(Control).Assembly.GetType(pi.PropertyType.FullName);<br />
foreach (PropertyInfo pi2 in myPropertyType.GetProperties())<br />
{<br />
if (pi2.Name == Property["PropertyName"].ToString().Trim())<br />
{<br />
MethodInfo mi2 = pi2.GetSetMethod();<br />
string str = Property["PropertyValue"] is DBNull ? "" : Property["PropertyValue"].ToString().Trim();<br />
if (str != "")<br />
{<br />
}<br />
break;<br />
}<br />
}<br />
}<br />
}<br />
}<br />
}<br />
Frankly, I've just started playing with Reflection and Assembly, so there are some gaps in my understanding. Am I even pointing to the right spot? If not, how do I do so?
I am not above changing the structure of my database if that will provide a solution.
Thanks for your help!
|
|
|
|
|
Hi, where can i foud how to implement databinding for new Lisview control windows forms 2.0.
I need to use it in virtual mode?
Thank you!!!
La realidad no es más que impulsos eléctricos del cerebro - Morpheus
|
|
|
|
|
|
thank you!!!!
Downloading...
La realidad no es más que impulsos eléctricos del cerebro - Morpheus
|
|
|
|
|
I'd like to aquire the published version number and display it (say, in a label).
How do I go about getting that information?
I've seen a few articles about the AssemblyInfo file however I still don't understand how to get the version values out of that either.
Thanks for the help!
|
|
|
|
|
I've got a small form that takes rankings from a user and submits it into a database. Nothing fantastic or difficult or anything. Anyway, I THEN find out after everything's just about set up that they now want rankings from 1-30 input via text box. They want the data validated so not to any number used more than once.
My question is this: What is the quickest/easiest/most painless way to go about validating all that. Does anyone know where I can find an example? Thanks for any input!
Ken
<---signature--->
Your kid gets into Duke.
You pay the tuition.
That tuition goes into my checking account.
My money in my checking account goes into beer, porn, and other such fun. Thank you
|
|
|
|
|
Hi Ken
Im new to .NET, but not new to coding...
My suggestion:
1. Charge the customer more money for the new feature.
2. Collect all input up front before populating your DB or DataTable Object. Create a collection and use the rankings as keys to populated the collection. If the user tries to reuse a rank, an error will pop, which you can propagate up to the User Interface prompting for a unique unused rank. After everything is filled in, populate the DB from the collection.
- or -
You could just make the rankings part of the DB a unique field or primary key. I think this would also throw a catchable error that you can use to prompt the user to use a new rank.
Not sure how much this helps, I've done something similar in VB6 putting everything in XML, but you didn't leave a lot of details
gl hf,
Pualee
|
|
|
|
|
Sounds like a start. Basically I'm collecting all the data upfront. There's a simple aspx page that the user comes to. The user then has a list of items that s/he has to put a ranking next to: 1-9, 1-20, and 1-5. All three ranking sets have to be done on the same page (chairman's orders). Upon hitting submit, the information has to be sent to a database and so forth. Basically, I need to make sure each group only has numbers 1-9, 1-20 and 1-5. I'm thinking your way's sounding rather not too complicated. Any other ideas on top of it would be greatly appreciated.
<---signature--->
Your kid gets into Duke.
You pay the tuition.
That tuition goes into my checking account.
My money in my checking account goes into beer, porn, and other such fun. Thank you
|
|
|
|
|
I still rather like the idea of using collection objects for each set. You can use the "lost focus" and "validate" events (not sure what they are called in .NET) on the text boxes for entering the values into its respective collection. If the collection fires an error, return focus to the textbox and ask for a unique value
If you use combo boxes instead of textboxes you could be cute and remove the values that are already used from the blank combos, but this might make some user frustration as they try to change values after initially selecting them. Bah, go w/ textboxes ^.^
|
|
|
|
|
Hi,
I can't begin to understand this one. I have a form with a tabcontrol. When I first enter one of the pages (whether by tabbing or opening the form), I say to focus on a button. It does focus on that button but you wouldn't know it by looking at it (the dotted rectangle isn't there). I noticed that when the Tab key was pressed, the newly focused button will highlight, so when opening the form, I focused on the button next to the one I want focused and did a SendKeys.Send("{Tab}"); . This works if the current tab page is the one in focus (I have another "screen" on that same tabpage where I can press an Exit button to return to the original screen), but it refuses to work when that tabpage is first opened - when tabbing into the page from another or opening the form. I'm completely out of ideas around this problem. Anyone know what I could do?
Thanks so much for any help!!!
Mel
|
|
|
|
|
Your solution looks like a hack. Did you try setting the TabIndex property in the Designer to set the right Tab order?
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
There are 6 comboboxes used on the Form, each combobox should be bind with sql server datasource with particular Table having six fields.After selection of each combobox one by one the output comes as appended string in Label .
as
ans of combobox1-ansof combobox2-.....- ans of combobox6
I want to bind combobox with sql server datasource ,using stored procedures how can i start with...?
Raj
|
|
|
|
|
If you open Registry Tab of Skype program, you can see a list of the same controll repeated much time.
It contain an image, a label and sometime a linklabel.
On the right side there is a scrollbar.
So how can i create controlls like that? Is it overloaded a simple multiline textbox or what?
thanks if someone try with me to get an answer
|
|
|
|
|
Hi!
I'm looking for some help - i'm using the COM Excel Spreadsheet, Version 11 and actually i'm trying to set the borders of an cell. But it fails every time - i've looked around one day for a solution - nothing - i get something like that...
Property, indexer, or event 'LineStyle' is not supported by the language; try directly calling accessor methods 'Microsoft.Office.Interop.Owc11.Borders.get_LineStyle()' or 'Microsoft.Office.Interop.Owc11.Borders.set_LineStyle(Microsoft.Office.Interop.Owc11.XlLineStyle)
What does that mean - can someone provide some code for this...
i'm using Microsoft.Office.Interop.Owc11 - because the com object as well uses Interop and not excel...
Thanks...
Ralf
FreewareFire
|
|
|
|
|
It means you shouldn't be calling get_LineStyle() directly ... there should be a property accessor available called LineStyle (or maybe just Style) available from the Office and/or Excel Namespace.
:..::. Douglas H. Troy ::..
Bad Astronomy |Development Blogging|Viksoe.dk's Site
|
|
|
|
|
Hi!
Thanks for answer. But still i can't get it work... I'm using the AxSpreadsheet... from the Office 2003. How can i set the bordes in that control?
Here's my Code:
<br />
Microsoft.Office.Interop.Owc11.Range NewRange = GridIt.get_Range("A1","A2");<br />
<br />
NewRange.Select();<br />
<br />
NewRange.Borders[Microsoft.Office.Interop.Owc11.XlBordersIndex.xlEdgeBottom].LineStyle = Microsoft.Office.Interop.Owc11.XlLineStyle.xlContinuous;<br />
Error occurs at .. .LineStyle = !!!
What should i do?
Greets
Ralf
FreewareFire
-- modified at 18:53 Friday 3rd February, 2006
|
|
|
|
|
Use this...it works NewRange.Borders[Microsoft.Office.Interop.Owc11.XlBordersIndex.xlEdgeBottom].set_LineStyle(Microsoft.Office.Interop.Owc11.XlLineStyle.xlContinuous);
Good Luck
Vikas Pradhan
|
|
|
|
|
is there a way to make my program control mouse?
i want it to move mouse pointer and performe some clicks on the active window(any other program running)
|
|
|
|
|
Hey there,
I'm working on a webpage using ASP and C#. At the server, I am tracking all of the live Sessions based on the HttpContext.Current.Session.SessionID value. As you probably know this is a value unique to each web browser accessing my pages.
Now my problem. I would like to know when a user closes the browser and leaves the site (assuming he/she doesn't "log out"). I am hoping to periodically check each SessionID to see if it is still current or expired. Is there a way to load a specific session based on its ID and check to see if it has expired or not?
If it matters, I am using cookies to store the session information.
Thanks in advance,
Pualee
-- modified at 11:10 Friday 3rd February, 2006
P.S. -- Im reading a few books and looking all over the web, but having difficulty finding good information about Sessions (I'm new to Web Development). If you know a good online faq or tutorial, please share the love/url here
|
|
|
|
|
Unless you use javascript in the browser to tell the server when the user leaves the page, there is no way that the server can know when this happens. If the user doesn't log out, the server session ends 20 minutes (at default setting) after the last request.
Any information you store in a cookie is only available when a request is made, as the cookie is stored in the browser.
---
b { font-weight: normal; }
|
|
|
|
|
Guffa wrote: Unless you use javascript in the browser to tell the server when the user leaves the page, there is no way that the server can know when this happens.
I'm not so much worried about the "event" of leaving, I just want to clean up some things periodically...
While still researching this topic, I have come across the following:
System.Web.SessionState.HttpSessionState class
.Count - Gets the number of items in the session-state collection
.Keys - Gets a collection of keys for all the values in the session-state collection
Shouldn't it be possible to loop on the .Keys to compare the active Keys against the keys my application believes are active? This might not be very scalable, but I'm not expecting thousands of users to connect per hour, this is a very specialized application.
I'm going to try this for now, but I'll be rechecking this board for feedback (never know when someone else has the same problem).
Also, would keeping the session data on server side, rather than as cookies, make this possible?
Pualee
|
|
|
|
|
You may want to consider setting a short (< 5 mins.) session timeout on your app and have every page periodically (using JavaScript) retrieve a very small resource (eg: a 1x1 pixel transparent .gif ) in an iframe .
/ravi
My new year's resolution: 2048 x 1536
Home | Music | Articles | Freeware | Trips
ravib(at)ravib(dot)com
|
|
|
|