[Solved] Set TextBox as required based upon “selected” value of DropDownList

Add following code in SelectedIndexChanged event in .cs file protected void PositionShift_SelectedIndexChanged(object sender, EventArgs e) { if (PositionShift.SelectedIndex == 1 || PositionShift.SelectedIndex == 3 || PositionShift.SelectedIndex == 5) { RequisitionNumberLabel.Text = “*”; } else { RequisitionNumberLabel.Text = “Requisition Number”; } } Also, set Autopostback property of DropDownList to True. solved Set TextBox as required based … Read more

[Solved] array that accepts a number only once(code doesn’t work) [closed]

it is observed from your code that given array must be filled but it should not contain redundant values. following code iterates until the array is filled with no redundant value, once the array is filled it terminates. int a[5],i=1,k=0,p; int num; scanf(“%d”,&num); a[0]=num; while(i<5) { scanf(“%d”,&num); for(p=0;p<=k;p++) { if(a[p]==num) { break; } if(p==(k)) { … Read more

[Solved] Can remove Nulls from Database using C#?

Something like the following will work DELETE FROM Table WHERE ColumnName IS NULL; GO The C# tag throws me. You can execute this command from C# using the SqlCommand class. UPDATE Table SET ColumnName=”DefaultValue” WHERE ColumnName IS NULL 1 solved Can remove Nulls from Database using C#?

[Solved] How to get data between certain quotes

Oh, come on. string s = “<script type=\”text/javascript\” src=\”/stepcarousel.js\”></script>”; int startIndex = s.IndexOf(“src=\””) + “src=\””.Length; int endIndex = s.IndexOf(“\””, startIndex); string src = s.Substring(startIndex, endIndex – startIndex); 1 solved How to get data between certain quotes

[Solved] c – What is a correct way of defining array? [closed]

The correct way to define and initialize your array is char Lookup[][3] = {“00”, “01”, “02”, “03”, “04”, “05”, “06”, “07”, “08”}; Each element of the array Lookup is itself another array of 3 bytes. Counting with the zero terminator, that’s enough space for strings 2 chars long. The number of elements in the array … Read more

[Solved] Replace text inside .txt file or .xml file using loop [closed]

Using xml linq : using System; using System.Collections.Generic; using System.Collections; using System.Linq; using System.Text; using System.Xml; using System.Xml.Linq; namespace ConsoleApplication { class Program { static void Main(string[] args) { string xml = @”<Root> <Tag1> <USA></USA> <UK></UK> </Tag1> <Tag2> <FRA></FRA> <USA></USA> </Tag2> </Root>”; XDocument doc = XDocument.Parse(xml); List<XElement> tags = doc.Descendants().Where(x => x.Name.LocalName.StartsWith(“Tag”)).ToList(); List<string> countries = … Read more

[Solved] gcc 4.7 Give me error message

The error says it all. Trying adding -std=c++11 or -std=gnu++11 to the compiler options in your NetBeans IDE. I’ve not used Netbeans but see this link where a snapshot of build variables is shown and that is where you need to add the compiler options. 1 solved gcc 4.7 Give me error message

[Solved] How can I update record in file in c++?

There are a number of problems here. First, updatedata is a std::ifstream, which means that it doesn’t have functions like write or seekp. Second, you’ve opened it in text mode, so you cannot seek to an arbitrary position in the file; you can only seek to the beginning or the end, or to a position … Read more

[Solved] Setting up a Loop [closed]

Some pseudocode : Set salesA, salesB, salesC = 0 While choice != ‘Z’ Begin Initials = InputString Number = InputNumber If string[0] == ‘A’ Then salesA += Number Else If string[0] == ‘B’ Then salesB += Number Else If string[0] == ‘C’ Then salesC += Number End Print salesA, salesB and salesC 1 solved Setting … Read more