Posts

Difference between Byte and Char in Oracle

If you define the field as VARCHAR2(11 BYTE), Oracle will allocate 11 bytes for storage, but you may not actually be able to store 11 characters in the field, because some of them take more than one byte to store, e.g. non-English characters. By defining the field as VARCHAR2(11 CHAR) you tell Oracle to allocate enough space to store 11 characters, no matter how many bytes it takes to store each one. I believe that in Oracle 10g, 3 bytes per character were used.

DATA TABLE BIND WITH GRIDVIEW

                                                  DATA TABLE BIND WITH GRIDVIEW DataTable TempTable = new DataTable();         TempTable.Columns.Add("Business_Place");         TempTable.Columns.Add("Within_State");         TempTable.Columns.Add("Outside_State");                DataRow dtrow;         dtrow = TempTable.NewRow();         dtrow["Business_Place"] = "Factories";         dtrow["Within_State"] = list[0].FACTORY_IN.ToString();      ...

Dictionary used for key value pair

       var dicQuarter = new Dictionary<List<Dealer>, int >();         dicQuarter.Add("-Select-", 0);             dicQuarter.Add("Quarter-I", 1);             dicQuarter.Add("Quarter-II", 2);             dicQuarter.Add("Quarter-III", 3);             dicQuarter.Add("Quarter-IV", 4);                                     ddlAuthorisedFullName.DataSource = dicQuarter;                     ddlAuthorisedFullName.DataTextField = "FULLNAME";    ...

How to Open PopUp Window

write this script on that aspx page from which the page is redirect to popup window   <script type="text/javascript">     function popup(url,width,height) {     var left = (screen.width - width) / 2;     var top = (screen.height - height) / 2;     var params = 'width=' + width + ', height=' + height;     params += ', top=' + top + ', left=' + left;     params += ', toolbar=no';     params += ', menubar=no';     params += ', resizable=yes';     params += ', directories=no';     params += ', scrollbars=yes';     params += ', status=no';     params += ', location=no';     newwin = window.open(url, 'd', params);     if (window.focus)     {         newwin.focus()     }     return false;  ...

Insert value from one table into exsiting table in oracle i.e merge

Merge Use the MERGE statement to select rows from one table for update or insertion into another table. The decision whether to update or insert into the target table is based on a condition in the ON clause. It is a new feature of Oracle Ver. 9i. It is also known as UPSERT i.e. combination of UPDATE and INSERT. For example suppose we are having sales and sales_history table with the following structure.   SALES Prod Month Amount SONY SONY SONY SONY SONY SONY JAN FEB MAR APR MAY JUN 2200 3000 2500 3200 3100 5000 SALES HISTORY Prod Month Amount SONY SONY SONY AKAI JAN MAR APR JAN 2000 2500 3000 3200 Now we want to update sales_history table from sales table i.e. those rows whi...
Image
Adding Dynamic Rows in ASP.NET GridView Control with TextBoxes and with Delete functionality In my previous examples, I have demonstrated on how to add dynamic rows in GridView control with TextBoxes and how to save the values into the database. Now, seems that most of the developers are asking if how to add a delete functionality with it. So in this example, I’m going to show on how to delete a certain row in the dynamic GridView with TextBoxes. Note: Before reading this example, be sure to refer my previous examples mentioned above so that you will have a basic idea on how the dynamic does TextBox is being generated in the GridView. Also in this example, I will only focus on the Deletion part so it means that I will not elaborate more on the dynamic TextBox generation. Here are the code blocks below: GRIDVIEW MARKUP (ASPX Source):       < asp : gridview ID ="Gridview1" runat ="server" ShowFooter ="true"  ...
Image
Save and Retrieve Dynamic TextBox values in GridView to SQL Server Database In my previous article, I have demonstrated on how to add dynamic rows in GridView control with TextBoxes. Now, seems that most of the developers are asking if how to save all the data that was entered from the dynamic textbox in the GridView to the database. So in this example, I’m going to show on how to save them all in the database. To get started then lets create a sample Table in SQL Server. In this example, I named the table as “SampleTable” with the following fields below: Note: I set the Id to auto increment so that the id will be automatically generated for every new added row in the table. To do this select the Column name “Id” and in the column properties set the “Identity Specification” to yes. Now let’s go ahead and proceed to ASPX source and add a Button for saving the data to the database. Take a look at the screen shot below: Now let’s ...