Data Access Layer & Business Login Layer in C#

When I started learning asp.net C# in my life, I didn't know what is Data Access Layer (DAL) and Business Login Layer (BLL).

What I know Data Access Layer (DAL) is to provide access to database in common place just like creating function. Likewise, Business Logic Layer (BLL) is just like controller between DAL and UI.

You can read how do they work in following pages

http://www.asp.net/%28S%28pdfrohu0ajmwt445fanvj2r3%29%29/learn/data-access/tutorial-01-cs.aspx

http://www.asp.net/%28S%28pdfrohu0ajmwt445fanvj2r3%29%29/learn/data-access/tutorial-02-cs.aspx

Set Identity on existing column

Database of one of our project is stored by Microsoft Access. As you know, MS.Access can't store much of data amount in it. Lack of such appearance, our website is spontaneously down whenever users surfing through it. That's why we need to upgrade our DBMS to MsSQL. So, I'm in rush of doing so. First of all, I need to export all data as XML file. Then, import these data to Ms.SQL. But I wanna keep certain ID column of each tables. That's why I import all data as OFF identity Mode. After importing, I need to turn ON. At that time, I'm in trouble. NO idea to do how to turn ON identity and thinking of various ways. Eventually, I gotcha.

Here we go..

view plain print about
1<cftransaction>
2<!---- Creating Temp Table ---->
3<cfquery name=Items datasource="DSN">
4CREATE TABLE Categories2
5(
6    C_ID int primary key identity(1,1),
7    C_Name nvarchar(500),
8    C_SortOrder int,
9    C_Text nvarchar(4000),
10    C_Parent int
11)
12</cfquery>
13
14<!--- Set OFF Identity --->
15<cfquery name=Items datasource="DSN">
16    SET IDENTITY_INSERT Categories2 ON;
17</cfquery>
18
19<!--- Migrate Data --->
20<cfquery name=Items datasource="DSN">
21    INSERT INTO Categories2(C_ID, C_NAME, C_SortOrder, C_Text, C_Parent)
22    SELECT C_ID, C_NAME, C_SortOrder, C_Text, C_Parent FROM Categories
23</cfquery>
24
25<!--- Set On Identity --->
26<cfquery name=Items datasource="DSN">
27    SET IDENTITY_INSERT Categories2 OFF;
28</cfquery>
29
30<!--- Drop old table --->
31<cfquery name=Items datasource="DSN">
32    DROP TABLE Categories
33</cfquery>
34
35<!--- Rename Table --->
36<cfquery name=Items datasource="DSN">
37    SP_RENAME Categories2, Categories;
38</cfquery>
39</cftransaction>

Tags & Controls example for CF & .NET Developer

In this weekend, I'm doing practise for .NET in my room because I'm sick of outgoing and no idea to do anything at outside. So, I've been creating small project with asp.net and c# about expenses for our flat. Being CF developer, I've lack of knowledge in C# so seeking how to use asp.net control through internet. Finally, I found two links for CF & ASP.NET. It explains how to use CF tags and asp.net controls.

http://coldfusion-example.blogspot.com/

http://asp-net-example.blogspot.com/

Access the value in frame

In my project, I need to access some value in top frame from my current working frame which is below of top frame. I was dilemma when I encounter this problem. Finally, I gotcha how to access.

Here you go,

view plain print about
1window.frames['frame_name'].document.form_name.input_field_name.value

Refresh parent window from child window with ShowModalDialog

Yesterday, I was in problem. Because, my supervisor told me to refresh main window from child window when child window is closed. I thought, I could do it with window.opener.location.href. Actually, it doesn't work because this new window is created by showmodaldialog of javascript. That's why I was running through on it. Finally, I got it.

Coding for parent window (main.html)

view plain print about
1<input type="button" value="Open" onclick="javascript:window.showModalDialog("child.html", window)">

 

Coding for child window (child.html)

 

view plain print about
1<invalidTag LANGUAGE="JavaScript">
2<!--
3function close(){
4
5if (window.dialogArguments &amp;&amp; dialogArguments.location) {
6dialogArguments.location.href = 'main.html';
7window.close();
8
9}}// -->

10</SCRIPT>
11
12<input type="button" value="Close" onclick="close()">

Remove spacing in textarea

It's simple problem for web developers. Sometimes, such problem make us to stop our progress by finding how to solve these problems. This problem is, when we cursor in our textarea box, this cursor isn't arrived to left align, it stays at center or somewhere else when we create our textarea box as so:

view plain print about
1<textarea name="mytextarea">
2Here is Value....
3</textarea>
But, how to solve this problem is kinda simple. Just do so.
view plain print about
1<textarea>Here is value</textarea>
How? It's simple, isn't it?

Coldfusion Report Builder

Of the most powerful and convenient report builder is Coldfusion Report Builder. It's absolutely just like crystal report. You can make your report design in CF report builder or you can use their built-in theme, either. Are you getting sick of writing query in cf report builder? It's ok. You can write Query in your cfm file and output report just like :

view plain print about
1<cfquery name="qryUsers" datasource="#application.datasource#">
2    SELECT * FROM Users WHERE
3    U_ID = <cfqueryparam value="#url.id#" cfsqltype="CF_SQL_NUMBER">
4</cfquery>
5
6<cfreport template="NewColdFusionReport.cfr" query="qryUsers" format="PDF">
7</cfreport>

Copy two tables in MsSql

Do you know how to copy two tables in mssql 2000? It's quite simple.

view plain print about
1SELECT *
2INTO master.dbo.micro_blog
3FROM master.dbo.micro_blog

Top of Page