Place this code under your main class. //Force application to use culture En-US. System.Globalization.CultureInfo cultureInfo = System.Globalization.CultureInfo.GetCultureInfo("en-US"); System.Threading.Thread.CurrentThread.CurrentCulture = cultureInfo;
happy coding...
Tuwing Sabado
Posts
-
Comma as Decimal Symbol creating problem -
How to concate various controls data into a TextBoxuse the string format
Month_no = string.Format("{0} {1} {2} {3} {4} {5} {6} ({7})", (ddl1),(ddl2),(txt1) (btn1),(ddl),(ddl2),(txt1),(ddl3));
happy coding... -
gridview bindinguse the HTML name attributre as place holder for other value.
protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e) { CheckBox chk = new CheckBox(); // use name html attribute as your ID placeholder chk.Attributes.Add("name", e.Row.Cells[100].Text); //e.Row.Cells[100].Text is my column id e.Row.Cells[0].Controls.Add(chk); } protected void Button1_Click(object sender, EventArgs e) { Int16 count = (Int16)GridView1.Rows.Count; for (Int16 i = 1; i < count; i++) { CheckBox chk = (CheckBox)GridView1.Rows[i].Cells[0].Controls[1]; //get the value of attribute name. string id = CheckBox3.Attributes["name"]; } }
happy coding.. -
Javascript for Gridview CommandfieldConvert your commandfield column as templatefield then replace the item template control by regular html link tag.
-
gridviewUse the GridView RowDataBound Event Delegate to change the value of one cell.
protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e) { e.Row.Cells[0].Text = e.Row.Cells[0].Text == "0" ? "Unread" : "Read"; }
Happy Coding... -
How to hide the black console windowNo need to change your existing code just change your project output type as Windows Application instead of Console Application. How to change your project output type 1. from your solution explorer right click your console project then choose Property menu. 2. from the application tab change the value of Output type dropdownlist. Happy coding...
-
Help me with formatted int32 strings. [modified]if your string format is constant to have a format like this "ABCD-0000000000", try to split your string to string array then get the second index value and lastly do your Int32.TryParse thing.
string[] myString = ("ABCD-000066123884").Split('-'); Int32.TryParse(myString[1],out intVar);
Happy Coding... -
Help me with formatted int32 strings. [modified]Your going to format your interger to a predefine format. Example 1
string outputString = (12345).ToString("ABCDE-0000000000"); //Output: "ABCDE0000000000"
Example 2string outputString = (12345).ToString("ABCDED-0000000000"); //Output: "ABCDED-0000012345"
If your are expecting that the output of Example 1 is ABCDE-0000012345 you are wrong because "E-0" means Scientific notation. Note: If any of the strings "E", "E+", "E-", "e", "e+", or "e-" are present in the format string and are followed immediately by at least one '0' character, then the number is formatted using scientific notation with an 'E' or 'e' inserted between the number and the exponent. The number of '0' characters following the scientific notation indicator determines the minimum number of digits to output for the exponent. The "E+" and "e+" formats indicate that a sign character (plus or minus) should always precede the exponent. The "E", "E-", "e", or "e-" formats indicate that a sign character should only precede negative exponents. See Custom Numeric Format String[^ for more details. Happing Coding... -
.net framework 3.5the default installation folder of .NET framework is in "[OS Drive]:\WINDOWS\Microsoft.NET\Framework" regards...
-
how to make a part of string as Bold??for web project.
Label2.Text = @"<b>Website</b> Code project";
happy coding... -
Want to validate a function and execute ittry this one.
[Platform(Platform.Win32NT)] [DllImport("somedll.dll")] public static extern int APIcall([In] int param1, float param2); public int CallTheAPI(int param1, float param2) { if (!System.Environment.OSVersion.Platform.ToString().Equals("Win32NT")) { throw new ApplicationException("Your current platform is not a Win32NT operating system."); } return APICall(parma1, param2); //If the current platform is not Win32NT it should }
-
binding value with listboxYou have a typo error from your first post. See the bold font below. query = "select CustId,FirstName+' '+LastName as Name from custdetails where BrokerId='" + Session["broker"] + "'"; dt = obj.select(query); ListBox1.DataSource = dt; ListBox1.DataTextField = "Name"; ListBox1.DataValueField = "CustId"; this.DataBind(); //"this" must be replaced by ListBox1.
-
binding value with listboxYour listbox biding is correct but you should place it under Page Load event delegate and "Not Page.IsPostBack" condition to retain your listbox state.
protected void Page_Load(object sender, EventArgs e) { if(!Page.IsPostBack) { query = "select CustId,FirstName+' '+LastName as Name from custdetails where BrokerId='" + Session["broker"] + "'"; dt = obj.select(query); ListBox1.DataSource = dt; ListBox1.DataTextField = "Name"; ListBox1.DataValueField = "CustId"; ListBox1.DataBind(); //<-- replace this with ListBox1 } } protected void Button1_Click(object sender, EventArgs e) { Label2.Text = ListBox1.SelectedValue; }
-
Data Access Layer For Oracle in asp.net 2.0Download the ODP.NET component from oracle web site or just simply get the latest the microsoft enterprise library for .net 2.0 then utilize the system.data.oracleclient namespace. FYI: sometimes the system.data.oracleclient component is not automatically loaded in “add reference” screen. You need to add this manually. The dll are located at “C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727” then look for System.Data.OracleClient.dll.
-
How do I find a XML element based on attributeSystem.Xml.XmlDocument xmlDocument = new System.Xml.XmlDocument(); xmlDocument.Load(@"c:\\text.xml"); // Fetch all 'item' xml elements with attribute 'No' equal to 1000 System.Xml.XmlNodeList xmlNodeList = xmlDocument.SelectNodes("//Item\[@No='1000'\]"); foreach (System.Xml.XmlNode xmlNode in xmlNodeList) { // Display the value of 'Item' xml element Console.WriteLine(xmlNode.Value); }
happy coding :) regards, mark
-
How can i save event logs using C# ?Use Microsoft Enterprise Library for Event Log, Flat file logging or Error Logging.
-
Property AttributesI got your point. You want to reflect all your property value immediately at design time from the IDE. Start researching the Custom Control Designers : Design-time HTML for ASP.NET[^]
-
Property Attributesyou should assign a value to your properties.
private int myVar = 200; \[DefaultValue(200)\] //<-- This attribute will make the 200 value as default (means not in bold in property grid) public int MyProperty { get { return myVar; } set { myVar = value; } }
-
Hi allNo need for resizing, treat inherited forms as a new form with extra codes and design.
-
Hi allHi, What is the reason why you want to place those panels in one form and not creating 3 different forms? Is it you want to reuse the method, function and properties of form you've created and you don't want to repeat this codes in other form plus they have the same look and feel with some slight differences in Pane1, Panel 2 and Panel3. If your answer is YES you should go to inherited form. NOTE: Methods and Properties of Parent Form are visible to inherited Form (Only Public and Protected access modifiers). Parent Form
.......................................................................
. .
. .
. |--------------------------| .
. | Static Design | .
. |--------------------------|
. .
. .
. .
. |--------------------------| .
. | Area for | .
. | Other Panel | .
. |--------------------------| .. .
. .
. .
. .
.......................................................................Inherited Form Locked Static Design means you can only edited this on Parent Form.
.......................................................................
. .
. .
. |--------------------------| .
. | Locked - Static Design | .
. |--------------------------|
. .
. .
.