
fguihen
Avatar/Signature-
Posts
251 -
Joined
-
Last visited
Content Type
Profiles
Forums
Blogs
Events
Articles
Resources
Downloads
Gallery
Everything posted by fguihen
-
i have an assembly loaded into my app. im trying to get at the attributes of this assembly so i have this code : foreach(Type OT in objDll.GetTypes()) { AssemblyTypeName[] custInfo = (AssemblyTypeName[])OT.GetCustomAttributes(false); } the problem is that i cant cast the return of "getCustomAttributes to an AssemblyTypeName array. i can get the return values when i use this: foreach(Type OT in objDll.GetTypes()) { Object [] custInfo = (AssemblyTypeName[])OT.GetCustomAttributes(false); } the problem is that when i try this: foreach( Object o in custInfo) { AssemblyTypeName atn = (AssemblyTypeName)o; atn.mycustomAttribute........ } i get an error here trying to cast the object to an AssemblyTypeName. what should i do? i can see my custom attribute and its value when i hover over the array and look at its contents , but i cant get to it. Just so youl know, assemblyTypeName is my own attribute that i created. i keep getting the error "unable to cast object of type "EmpManagment.AssemblyTypeName" to type "EmpManagment.AssemblyTypeName"
-
i decared a custom attribute class: [AttributeUsage(AttributeTargets.Class|AttributeTargets.Field|AttributeTargets.All, AllowMultiple = false)] public class AssemblyTypeName : System.Attribute { string itemName; public string NameOfClass { get { return itemName; } } public AssemblyTypeName(string nameOfClass) { itemName = nameOfClass; } } now, just above the class that i want to use the custom attribute i place the line: [ AssemblyTypeName("BusinessEmployee")] i read in the assembly data for the assembly that uses the custom attribute,but i cant find out how to access my custom attribute ( before i instantiate the class).it is being used to identify the class in order to see if its the one i want to create an instance of.
-
does the fact that you have to have a descriptor class not go against the plugin idea that as long as you have an interface, the plugin will work with your specified app. with a descriptor class , you also need to create the descriptor class, which makes your plugins not as easily implementable by anyone . ( hope you get my point, kinda hard to put it into words
-
if i use attributes and look at them using reflection, is it possible to specify an attribute in the interface for the plugin, so all classes that implement the plugin have to contain that attribute, maby name or something?
-
im playing with the plugins tutorial on this site which is great. i have one question. is there any way that i can have an identifier in a class library, and read that ( a string name or something) that i can use before the class is actually instantiated? its so i can get the names of all the various plugins, and put them in a combo box and the user can select which one they want to instantiate without instantiating all of them.
-
yea, that sample would be great. thanks for the responses guys
-
doing a little project. im demonstrating inheritance. i have an employee class. classes which inherit this are BusinessEmp, MaintenanceEmp, ITEmp....... i have a form to create employees. a dropdown box lets me select the employee type. rather than hardcoding it if(combo.selectedItem = "businessEmp") { //create new businessEmp } if(combo.selectedItem = "ITEmp"() { //create new ITEmp } ... ... i want it to be extensible, so that if someone added a different type of employee, all they would have to do is add in the new employee class. is this possible ( cant use a database)?i can hard code them if i want, but id rather learn to do it this way, seems like there would be more merrit to it
-
the grid is an MsFlexGrid, just in case your wondering
-
I have grid , i think its a data grid, but im not sure. anyway, the textArray property is being initialised when a button is clicked. the second time around i get a subscript out of range error. how do i loop through each element in the array and delete it? this might seem like a basic question, but its years since i touched vb6 and dont remember much of it
-
im trying to step into sprocs so as to debug them. im running visual studio pro 2005, and sql server 2005.i have checked"allow sql/ clr debugging" and i am sure that i am admin on my machine and on the DB server. this is the error i get. has anyone come up against this and how did you solve it? the error i get is: Unable to start T-SQL Debugging. Could not attach to SQL Server process on <servername>.The rpc server is unavailable
-
i want to step through a sproc as its being called. im testing an app and this would be the easiest way to debug. i dont have visual studio 2005. is there any way in sql server 2005 to insert a breakpoint into a sproc and step through it?
-
trying to deploy sproc as web service. Posted on: 03/06/2006 02:52:27 i have written a simple sproc and i want to expose it as a web service. heres the code i thought should do so: Create ENDPOINT TestWebService5 STATE = STARTED AS HTTP ( PATH = '/TestWebService5', AUTHENTICATION = (integrated), PORTS = (clear), site = 'Dbrmsiis01' ) FOR SOAP ( WEBMETHOD'TestWebService' (name='Rebate.dbo.TestWebService'), DATABASE = 'rebate', WSDL = DEFAULT ) now the server Dbrmsiis01 is a different, IIS server on the network. the server that sql server is on is different. everytime i try to view the WSDL, its not on the server. am i doing something wrong, or do i have the idea of whats going on wrong? what link do i type into the browser to see the page describing the web service, as in visual studio web services?
-
When i go to start a new project, and i want to create a windows app, i cant find the windows app template. there are no templates except blank template. if i add a blank template and go to solution explorer and try to add a form or new project all i am offered is sql analytical services and reporting services. how do i go about installing all the templates that usually comes with visual studio? im running visual studio 2005, and i think its enterprise edition. if i create blank project and try to add a form , i cant. all i can add is things like cursor, xml doc, , xsl scheema, html page and a few more things like that, but there are no forms or classes to select. am i working with a completely wrong version of visual stuido? it seems to be geared completely toward sql server when i go to help , and "about visual studio", i get a list of installed products, shown below: Microsoft Visual Studio 2005 Version 8.0.50727.42 (RTM.050727-4200) Microsoft .NET Framework Version 2.0.50727 Installed Edition: Standard Visual Studio 2005 Team Explorer 77633-163-9000041-41175 Microsoft Visual Studio 2005 Team Explorer SQL Server Analysis Services Microsoft SQL Server Analysis Services Designer Version 9.00.1399.00 SQL Server Integration Services Microsoft SQL Server Integration Services Designer Version 9.00.1399.00 SQL Server Reporting Services Microsoft SQL Server Reporting Services Designers Version 9.00.1399.00 its all to do with sql server. what do i need to install to give me the ability to develop c# app's?
-
i was thinking of paypal, but im not sure if many of the people who would be buying from this site would have paypal accounts or want the hassle of signing up. so a simple ( or not so simple as the case may be) credit card payment system may suit this particular scenario a better.
-
how do i begin adding credit card payment to a website? can someone pont me to a decent tutorial? are there issues with storing credit card numbers, or do i have to strore them at all? will the implementation be different depending on where the web site will be hosted? what other security issues are there to consider? thanks all
-
i have run a query in access which returns a lot of rows. what is the sql syntax to save the returned data in a new table?
-
i have a datagrid bound to a table. i am adding and deleting records using the datagrid. here is the code behind my delete button: private void button4_Click(object sender, System.EventArgs e) { int dfd = ds.Tables["visit_activities"].Rows.Count; foreach(DataRow r in ds.Tables["visit_activities"].Rows) { if(r.RowState == DataRowState.Deleted) { dfd = dfd - 1; } } if(dfd >= 0) { int i = this.dataGrid1.CurrentRowIndex; DataRow row = ds.Tables["visit_activities"].Rows[i]; row.Delete(); ds.Tables["visit_activities"].Rows.Remove(row); this.dataGrid1.Refresh(); } else {} } the problem is that this works most of the time, except sometimes when it doesnt remove the row as its still visible in the grid, yet it does not throw an error.i select the row i want to delete, click delete, all the code executes but nothing seems to happen. it happens when im down to 2 records left displayed in the dataGrid. can anyone tell me what might be happening
-
my oleDb Delete commands are not working. i have an oledbDataAdapter with insert, update and delete commands like so: this.daRequests.InsertCommand = conn.CreateCommand(); this.daRequests.InsertCommand.CommandText = "insert into requests(patient_id,requests)" + "values(@patient_id,@requests)"; this.daRequests.InsertCommand.Parameters.Add("@patient_id",OleDbType.VarChar,50,"patient_id"); this.daRequests.InsertCommand.Parameters.Add("@requests",OleDbType.VarChar,120,"requests"); this.daRequests.UpdateCommand = conn.CreateCommand(); this.daRequests.UpdateCommand.CommandText = "update requests set requests = ? where patient_id =?"; this.daRequests.UpdateCommand.Parameters.Add("@requests",OleDbType.VarChar,120,"requests"); this.daRequests.UpdateCommand.Parameters.Add("@patient_id",OleDbType.VarChar,50,"patient_id"); this.daRequests.DeleteCommand = conn.CreateCommand(); this.daRequests.DeleteCommand.CommandText = "delete from requests where patient_id = @patient_id and requests = @requests"; this.daRequests.DeleteCommand.Parameters.Add("@patient_id",OleDbType.VarChar,50,"patient_id"); this.daRequests.DeleteCommand.Parameters.Add("@requests",OleDbType.VarChar,120,"requests"); the insert commands work fine. i dont really use the update ones as the table is mapped to a data grid so a row is either added or deleted, not edited. can anyone see a problem with the delete statement?
-
i have a form with a text field on it. to populate that text field, i have a little button that brings up a search form to fnd the relivant data. i want to pass this data back to the first button when i click a button on the search form. this is proving supprisingly hard to do. can anyone offer me some help?
-
thank you, however your answer is a bit more complex than i require. i want to know how do i make a form appear at the side of an existing form, to show controls that are hidden when this piece of form is not visible. animation is not important, just as long as i can make the piece of the form appear and disappear on request is more important
-
i want to be able to click a button on a form, which will make a piece slide out of or appear at the side of the form, which i can close again without closing the form. the piece that slides out/appears is to contain more controls. is this possible?
-
is there any easy way of finding out if i have reached the end of a line in a text box, so that if the text spills onto the next line il know, i can do something with it? i have thought about counting the charachters and stuff, but just wondering if theres a simpler way. im not entering the text directly into the text box, im entering it via code, you know textbox1.text = "abcde...";
-
thank you. its been bothering me a while now. thanks for explaining. i was looking at it the wrong way completely.