I am confused that predefined datatypes like String,Integer Int32 etc. are Class or something else? Since there symbols that appears through intellicence are different than other classes. The predefined datatypes have different Symbols than Classes. What could have been written inside those datatypes?
I have an application that allows admins to add types such as document types and training types that are in seperate tables with a foreign key in a transaction table.
When structuring my class I decided to go with an abstract-like pattern (without the factory methods though). So I have a Type abstract class that defines my Save, Delete, and GetList methods. I have a training type class that inherits this class. The thing is all types have 3 main properties - defined in the abstract base - but have different source tables and thus different store procedures in my DbCommand object. So basically I repeat setting up the same parameters on all the derived classes. I would like to implement the common stuff in the base but I am getting thrown off by the difference in data sources.
I need to convert .NET data to XML types and viceversa and I wonder if there is any class already on the .NET framework to do it. UPDATE I want to perform a data type conversion.
Using the following Webservice definition using aClientArgs as a complex type:
[System.Web.Script.Services.ScriptService] public class Controller : System.Web.Services.WebService { [WebMethod] public void save_client(aClientArgs client) { // Save client data } } Then defining aClientArgs as a sub-class: public class aArgs { public string id = null; public string name = null; } public class aClientArgs : aArgs { public string address = null; public string website = null; } Returns the following WSDL fragment for the save_client args: <save_client xmlns="http://tempuri.org/"> <client> <address>string</address> <website>string</website> </client> </save_client> When I'm expecting the following: <save_client xmlns="http://tempuri.org/"> <client> <id>string</id> <name>string</name> <address>string</address> <website>string</website> </client> </save_client>
So it appears that the .NET WebService is not treating inherited properties as arguments/variables for purposes of a web service. How do I get .NET to also use the properties of the base class?
I need help writing a class that will contain three values per item. I'll be passing parameters to a report: Parameter Name, Data type (int, string, date, etc), and Value. When I pass those values to the report using the class they should be in original form (i.e. an integer should be a numeric, a string should be a string, etc.).
I can do it converting the data's value to strings on one end, and reconverting to the original data type on the other, which seems like a lot of runaround. Is there a simple way? Also, if I'm able to store & retrieve the data in it's native format I don't need the "Data type" stored.
This is the error i'm getting while try to view class diagram,any suggestion.Some of the seleced types cannot be added to the class diagram.Checks the code for errors and ensure that all required assemblies are referenced.
If I'm returning an object, then it's pretty straight-forward. However, if I'm just trying to return whether or not the method was successful or not, what's the best option? Sure ... bool seems obvious - but what if you need to debug or get some additional details out of the method than just "yes/no"? Well that's where a string becomes more obvious, right? You can leave it empty to say that the method was successful or chock it full of details in the case of an error. But this can make it less intuitive to others who may have to run your functions and it also jumbles up everything you wanted to pass back into one large string.
I want to add a class to a div inside my repeater control based on whether the query string value is true or false, so that I can style it differently.
WHAT EXACTLY I WANT IS TO RETRIEVE DATA(may be from separate table) AND THEN DISPLAY THEM PUTTING SOME STYLE(font,color etc). Is retrieving from multiple table is possible in gridview ? I could use the DataReader, but how to display them in style(font,color etc)?
Without having to use logic to do this, I would like to store the names of Classes as Strings in one of my Database tables. When I retrieve the String from the table, I would like to some how use the string to make reference to the Class?
For example.
I store "Class1" as a string in my table.
I retrieve "Class1" as a string from my table.
I (somehow) convert the string "Class1" so it is usable in such an instance as...
I need to pass a string from my .aspx page to my .VB class.
i need to capture (device_category; accept_headers : user_agent) and pass the values to my class, i tryed to captur the values on the clas itself but i got an error(valuse are not member of this class..)
I'm very much a vb person, but have had to use this id number class in c#. I got it from [URL]
using System; using System.Text.RegularExpressions; namespace Utilities.SouthAfrica { /// <summary> /// Represents a South African Identity Number. /// valid number = 7707215230080
I m Using a GridView: Columns: "Ser_type" tells what type of data is it i.e. VC for Varchar, NU for Numeric, DT for DateTime etc, for the time being i m using datavalidation controlls at design time. this is not a good approach. I just wan to do is that, DataValidationControlls should be created at RunTime and TextBox should validate data at runtime only. i.e. if Data required in the TextBox is of Type VC then it should validate only at runtime, if DT then validate DateTime only at Runtime similarly for all dataType:
I have IEnumerable object with value1 and value2. value2 is an array and value1 is string. I want to databind this object to Listview like that. So both value1 and value2[0] (always first item in array) could be accessed via <%# Eval("value1") %> and <%# Eval("value2") %> .
I am sitting with a situation where i have a Method that that i want to put into a Class because i am calling it from various forms.
The method in this case loads a dropdown list. Currently i am stuck where i have to load the list into the DropDown Control on the form. I dont seem to get the control on the form. So far my code looks something like this This does not seem to work. I keep getting this error...
Error 3 Argument '1': cannot convert from 'string' to 'int'
Or any class that's not X.aspx.vb. I've imported the Globalization, Threading, Threading.Thread, and UI.Page namespaces. But it won't come up in Intellisense and it gives error lines in my code. Is there a way to access use the GetLocalResource("Y") method in other classes?
I have an c# Class Library where I need some dynamic template based text. Instead of inventing my own template parser I thought I could create an aspx file in my project that is executed at runtime and, instead of viewing the output in a browser, I want a StreamReader or string object that holds the result.
Well i am just trying to test interoperability between ASP.net And Java web services, wanted to know what are the INTEROPERABILITY issues concering DATA TYPES that are there between the 2?
Since we can access the private data member of base class in the derived class with the help of friend function. How can we do the same in C# asp.net? I mean whats the alternative of friend function in C# asp.net
The biggest difference between double and decimal is that double is a floating point variable type whereas decimal is a fixed point variable .What it means?? Please Explain the abovePoint with Example.According to me both are used to store the folating numbers,then whats the difference between two?
I am getting ready to just write my own, but I have a need for some regular expressions that will validate strings to make sure they are in an acceptable format to be inserted/updated into a database field. I figure it may just be to find a list of them someone has already posted somewhere and just use those.
In my ASP.NET MVC 2 web application, I allow users to create custom input fields of different data types to extend our basic input form. While tricky, building the input form from a collection of custom fields is straight-forward enough.However, I'm now to the point where I want to handle the posting of this form and I'm not certain what the best way to handle this would be. Normally, we'd use strongly-typed input models that get bound from the various statically-typed inputs available on the form. However, I'm at a loss for how to do this with a variable number of input fields that represent different data types.A representative input form might look something like:
My date field: [ date time input control ] My text field: [ text input field ] My file field: [ file upload control ] My number field: [ numerical input control ] My text field 2: [text input field ] etc...
Ideas I've thought about are:Sending everything as strings (except for the file inputs, which would need to be handled specially).Using a model with an "object" property and attempting to bind to that (if this is even possible).Sending a json request to my controller with the data encoded properly and attempting to parse that.Manually processing the form collection in my controller post action - certainly an option, but I'd love to avoid this.Has anyone tackled an issue like this before? If so, how did you solve it?Update:My "base" form is handled on another input area all together, so a solution doesn't need to account for any sort of inheritence magic for this. I'm just interested in handling the custom fields on this interface, not my "base" ones.Update 2:Thank you to ARM and smartcaveman; both of you provided good guidance for how this could be done. I will update this question with my final solution once its been implemented.