.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
david stephan
Gaurav Pal
Post New Web Links

Should I make my input fields have values of Yes/No or 0/1?

Posted By:      Posted Date: April 10, 2011    Points: 0   Category :

Suppose I am trying to predict response to a promotional mailing.  I have many input fileds where I could either make the values 1/0 or Yes/No. For example the input field 'Lives near public transportation'. In my data I can either have it be Yes/No values or 0/1.   Which one is the better practice for the goal of data mining? Or does it matter?

View Complete Post

More Related Resource Links

Values in user control fields empty when AutoEventWireup=true ?

As a BizTalk developer I'm trying to build a ASP.NET website so some obvious things might be new to me (so please be gentle). I have a web form and I have a user control on it. This user control contains a panel with some user properties that are to be stored in a database. So far nothing fancy. The user control itself contains a panel and is working fine (all code to retrieve and store the values is working). I used the default settings of creating a user control and one of them was AutoEventWireup=true. This works fine because I also have some dropdown boxes (and other fields) that need to be filled with values from the database and that happens in the Page_load event. The panel specifies the 'DefaultButton' which calls a method when clicked to save the values after the user has changed them. On this click the code of the method is called, I confirmed that, but I found out that the values of my controls on the user control (for example the Textbox control) are empty. As a non-ASP.NET developer I couldn't figure out why. So I changed some settings like AutoEventWireup to false. Off course this resulted in my dropdown boxes no longer to be initially filled, but my surprise was big to find out my controls actually contained the values the user typed in. Logically I need both the values and th

How do you add duplicate fields to a SSRS custom report and receive differtent output values.

I have built a custom report in SSRS 2008 using fields for supplier and customer.   I have added a Parent Row Group using the Supplier field for the group expression and used the Customer Details as my child details group. This returns a list of all customers for each supplier.   (Supplier | = Customer details ( Name, Dob etc.)   How would I add an additional Supplier field to the customer details returning only values for other Suppliers used by a customer, not the value of the Supplier listed in the Parent Group?

How to make Hidden Fields appear on every other page when there are other data regions exist on the

Dev Environment: Visual Studio 2008 Client reporting(.rdlc) I have a client report with one hidden field and one table. The data for the hidden field come from one dataset and the data for the table comes from another dataset. Since there is huge data on the report, the table data spans multiple pages. at the same time i want the hidden field to appear on every other page along with table. i'm using these hidden for report header purposes. As an alternative i have used hidden parameters instead of Hidden Fields. Are there any alternatives other than this ? -- Praveen

Number of query values and destination fields are not the same

If RadioButton1.Checked = True Then rbtn = 1 Else rbtn = 2 End If ' Our insert command strSQLQuery = "INSERT INTO tblJobs " _ & "(filingDate, filingDay, reportDate, reportTime, company, jobsite, location, duration, DrugTestReq, foreman, instructions, jobSteward, nPlumbers, nFitters, nWelders, nTradesmen, nPlAppr, nFitAppr, nServTech, nHelpers) " _ & "VALUES (@DTValue, @TextDay, @DTValue2, @TextValue, @TextValue2,@TextValue3,@TextValue4,@TextValue5,@rbutton,@TextValue6.@TextValue7,@TextValue8,@NumVal,@NumVal2,@NumVal3,@NumVal4,@NumVal5,@NumVal6,@NumVal7,@NumVal8)" ' Create new command object passing it our SQL insert ' and telling it which connection to use. objCommand = New OleDbCommand(strSQLQuery, objConnection) ' Add parameters that our SQL command takes: 'radio button 'OleDbType. objCommand.Parameters.Add(New OleDbParameter("@rbutton", OleDbType.LongVarChar)) '- objCommand.Parameters.Add(New OleDbParameter("@DTValue", OleDbType.Date)) objCommand.Parameters.Add(New OleDbParameter("@TextDay", OleDbType.LongVarChar)) objCommand.Parameters.Add(New OleDbParameter("@DTValue2", OleDbType.Date)) objCommand.

Is there a way to make SPS 2003 search fields search the MOSS indexes?

Here's my situation: We're doing a gradual migration from SPS to MOSS. Can anyone tell me if there's an easy way to make the SPS search fields search the MOSS indexes? The easiest way I can think of is to great a web part for SPS which will gather the scope and search param and redirect the user to the MOSS search result page. If there's an easier way. I'm all ears.

Null values in formula fields

Hi,I tried using this and am concatenating the fields together.  It does not appear to be working.  Here's what I have.  Any suggestions?   IIF(IsNull({nomination.recparty1}), '0.0', {nomination.recparty1} ) &  chr(13)IIF(IsNull({nomination.recparty2}), '0.0', {nomination.recparty2} ) & chr(13)IIF(IsNull({nomination.recparty3}), '0.0', {nomination.recparty3} )andif IsNull({nomination.recparty1}) then '0.0' else {nomination.recparty1} & chr(13)if IsNull({nomination.recparty2}) then '0.0' else {nomination.recparty2} & chr(13)if IsNull({nomination.recparty3}) then '0.0' else {nomination.recparty3}Both this gets failed beacuse my fields are returned as null.Please get me to solve this.Thanks in advance.Regards,Mugil

System.Reflection: How to use the name of fields within classes to get the values?

Hey there, I have  a class defiend as follows:public class VisitorStat { public int? PageViews { get; set; } public int? Visits { get; set; } public int? Visitors { get; set; } ... } At some point in my program, I need to gather the  Visitor stats and create a report table.List<VisitorStat> visitorStats = GetVisitorStats(startDate, endDate);   My issue is this: Because there are many rows in the table, rather than hard coding the name for each row as: "PageViews", "Visits", "Visitors"... I want a way to use the name of the fields in the class to create the Row name and insert the appropriate values. I found out about System.Reflection and wrote the following:  Type type = typeof(VisitorStat); // Get type pointer FieldInfo[] fields = type.GetFields(); // Obtain all fields //Start creating a row for each field in the class foreach (var field in fields) // Loop through fields { object temp = field.GetValue(null); //The first cell in the Row contains the name of the field Cell Col2Row1 = new Cell(new Paragraph(field.Name)); PdfTable.AddCell(Col2Row1); //for item returned when calling the function to get t

How to add values of a fields (decimal numbers) to another field?

I have bunch of decimal fields on an InfoPath form and I need to add them up into a totals field when the form is saved.  How can I do that ?

How to INSERT new row values from two different sources, all fields from a table plus one additional

--Loading the single row returned by a table valued function into a temp table works fine like this:
DECLARE @techNumLoop VARCHAR(25)

 Names Varchar(25)
,Item_Count Integer
,Expense_AP MONEY
--,[...20 more fields]
--Loop a while
INSERT @myTemp SELECT * FROM ufn_FindSomeRow(@techNumLoop)
--And finally display a table with one row for each function call
--My Question: what if I would like to also display the value of @techNumLoop passed in to ufn_FindSomeRow?
--Then I add a field to @myTemp to hold it:
 TechNum VARCHAR(25)--added

Label of parameter = values of 2 fields



I would like to create a parameter that has as value, the combination of 2 fields of my dataset.
Say like Name and FirstName combined as EmployeeName
There is no chance I can update/change the procedure that delivers these fields.

I tried looking into the code, but didn't have a lot of success.
Anyone some ideas?


How to set values on multiple fields, from one drop down?


Hi all

In my form I have a budget. With fields from January - December, and Q1 - Q4 etc.

We have one drop down field where we can choose currency (USD, EURO, GBP etc.). When choosing one of them from drop down, I need to tell the users that this currency is used, by putting the the name of the currency on all budget - fields, i.e. 100 USD, 100000 USD etc..

How can this best be achieved ?
Do I have to write custom code on change event or something like that?


Arbritrary input fields on page



I am looking for some adivce about the possbility of doing the following while working whith MVC.

Firstly sorry if the subject line is not very descriptive.

I have put something together in ASP WebForms where by I can put a few core fields on my page that identify an object, e.g. an Event Name and ID... and then I can add arbritrary fields to the aspx page that are now saved and retrieved with the "owning object". These extra fields are stored in a seperate table on the database to the primary object fields.

A short explanation of how this works:

1. I have my own version of TextBox (and other input controls) called r3d:TextBox (etc.) and this text box has XmlParent and XmlElement tags, this is done by way of an interface.

2. I have a r3dBase page that all my forms inherit from and this page check for the existstance of any r3d:TextBox (and other input controls) that have the XmlParen and XmlElement tag defiened.

3. When an iheriting form is saved the controls with the Xml tags defined are also saved, but I don't have to change any code in the code behind pages. The framework I have put in place takes care of this for me. The data is saved

4. When an inheriting page is loaded all controls with the XmlParent and XmlElement tags are populated with any data that has previously bee

How To: hide fields on an input form


How can I hide a field in SP 2010.  I used this code in SP 2007 but can't get it to run in the new pop-up forms in SP 2010.


function findacontrol(FieldName, action) {

   var arr = document.getElementsByTagName("!");
   // get all comments
   for (var i=0;i < arr.length; i++ )
      // now match the field name
      if (arr[i].innerHTML.indexOf(FieldName) > 0) {
       if (action == "none") {
     } else {
       return arr[i];

function hideFlds() {

   var control = findacontrol("Request Status", "none");

Unable to retrieve Lookup fields or item URL values from Library(Wiki Page Library) item when using



When I execute, "l["Category"].ToString();" and the field is a lookup field it returns, "Microsoft.SharePoint.Client.FieldLookupValue[]", on the other hand when I execute "l["Description"].ToString();" which is a normal string field I get the string(multiline) value back, any idea what could be going on here? I have tried, static/internal/displayname all with the same result(lol moment,

Validation rule on fields with calculated values


Using Infopath 2010.

I used the rules wizzard to add a rule to a field that has a calculated value property and I tried eveything to get this to work. Is this rule suppose to work.

Check calculated value field (week1)- validate as error if greater than 7.

Here is the rule:


Week1 > 7      and
Week1 is not blank

Rule Type:


I expected this to work.

Appreciate confirmation that is is suppose to work. 



how to make fields readonly using java script





how to make the richtext editor and people picker fields read only in Editform.aspx page of a list ,through javascript





can any one guide me regarding this

Restrict Number of Input Fields


How do I restrict the number of input fields in the form to match the size of the columns?

Table Columns Reads:

state: Type Char; Length: 2
zip: Type: char; Length: 5   
Phone: Type: char; Length: 12    
Fax: Type: char; Length: 12     
Email: Type: nvarchar; Length: 256 

BoundField Reads:

<asp:BoundField DataField="state" HeaderText="State:" SortExpression="state" />

<asp:BoundField DataField="zip" HeaderText="Zip Code:" SortExpression="zip" DataFormatString="{0:#####}" />

<asp:BoundField DataField="phone" HeaderText="Phone Number:" SortExpression="phone" DataFormatString="{0:(###) ###-####}" />

<asp:BoundField DataField="fax" HeaderText="Fax Number:" SortExpression="fax" DataFormatString="{0:(###) ###-####}" />

<asp:BoundField DataField="email" HeaderText="Email Address:" SortExpression="email" DataFormatString="&lt;a href=mailto:{0}&gt;{0}&lt;/a&gt"


ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend