દીકરો મારો લાડકવાયો

January 24, 2009

દીકરો મારો લાડકવાયો દેવ નો દીધેલ છે,
વાયરા જરા ધીરા વાયજો એ નીંદમાં પોઢેલ છે.
દીકરો મારો લાડકવાયો…..

રમશું દડે કાલ સવારે જઇ નદીને તીર,
કાળવી ગાયના દૂધની પછી રાંધશું મીઠી ખીર,
આપવા તને મીઠી મીઠી આંબલી રાખેલ છે.
દીકરો મારો લાડકવાયો…..

કેરીઓ કાચી તોડશું અને ચાખશું મીઠા બોર,
છાંયડા ઓઢી ઝુલશું ઘડી થાશે જ્યાં બપોર,
સીમ વચાળે વડલા ડાળે હીંચકો બાંધેલ છે.
દીકરો મારો લાડકવાયો…..

ફૂલની સુગંધ ફૂલનો પવન ફૂલના જેવું સ્મિત,
લાગણી તારી લાગતી જાણે ગાય છે ફૂલો ગીત,
આમતો તારી આજુબાજુ કાંટા ઊગેલ છે.
દીકરો મારો લાકડવાયો…..

હાલકડોલક થાય છે પાપણ મરક્યા કરે હોઠ,
શમણે આવી વાત કરે છે રાજકુમારી કો’ક,
રમતાં રમતાં હમણાં એણે આંખડી મીંચેલ છે.

દીકરો મારો લાડકવાયો દેવ નો દીધેલ છે,
વાયરા જરા ધીરા વાયજો એ નીંદમાં પોઢેલ છે.
દીકરો મારો લાડકવાયો…..

Code Generator

December 12, 2008

<%@ Page Language=”C#” %>
<%@ Import Namespace=”System.Data” %>
<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN” “http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”&gt;

<script runat=”server”>
//TODO:
// Create an Object of the DataTable You need class for
// Assign Connection string name from Web.config
// Assign Data Set Name
//public aspnetdb.ModulePermissionDataTable dt = new aspnetdb.ModulePermissionDataTable();

User.ApplicationModuleDataTable dt = new User.ApplicationModuleDataTable();
//CodeGenerator.TBL_ITEMPROPERTIESDataTable dt = new CodeGenerator.TBL_ITEMPROPERTIESDataTable();
public string TableName
{
get
{
String tblName = dt.TableName.Replace(“DataTable”, “”);
tblName = “cls”+tblName.Replace(” “, “”)+”_CDO”;
return tblName;
}
}
public string ConnectionStringName = “dbLocalSqlServer”;
public string DataSetName = “CodeGenerator”;
public StringBuilder param = new StringBuilder();
</script>

<html xmlns=”http://www.w3.org/1999/xhtml”&gt;
<head id=”Head1″ runat=”server”>
<title>Untitled Page</title>
</head>
<body>
<form id=”form1″ runat=”server”>
<div>
<pre>

/*
COMPANY NAME        : DILIGENT INFOSYS, AHMEDABAD
PROJECT NAME        : ID MANAGEMENT SYSTEM
CREATE BY           : RAJESH B PRAJAPATI
CREATE DATE         : <%= DateTime.Now %>
PURPOSE             : FOR <%= dt.TableName%>
MODIFY BY           :
MODIFY DATE         :
MODIFY PURPOSE      :
*/
protected void Page_Load(object sender, EventArgs e)
{

if (!Page.IsPostBack)
{
bind_grid();
pnlGrid.Visible = true;
pnlTrans.Visible = false;
}
}
#region “Private Function”
//Clear Text Function
private void ClearText()
{
<%
foreach (DataColumn col in dt.Columns)
{
%> txt<%=col.ColumnName%>.Text =String.Empty  ;
<%
}
%>
}
//Enabled/Disabled Control Function
private void setText(Boolean flg)
{
<%
foreach (DataColumn col in dt.Columns)
{
%> txt<%=col.ColumnName%>.Enabled =flg;
<%
}
%>
}
private void Load_Data(ref <%=TableName%>  <%=dt.TableName %>_CDO)
{
<%
foreach (DataColumn col in dt.Columns)
{
if (“String” != col.DataType.Name.ToString())
{ %>
<%=dt.TableName %>_CDO.<%=col.ColumnName%>  = <%=col.DataType.Name %>.Parse( txt<%=col.ColumnName%>.Text);
<%   }
else
{ %>
<%=dt.TableName %>_CDO.<%=col.ColumnName%>  =  txt<%=col.ColumnName%>.Text;
<%   }%>

<%
}
%>
}

private void setValues(DataSet ds)
{
<%
foreach (DataColumn col in dt.Columns)
{
%>txt<%=col.ColumnName%>.Text = ds.Tables[0].Rows[0][“<%=col.ColumnName%>”].ToString();
<%
}
%>
}
// Common Switch case Function For Save Data
private Boolean Common_Switch_Case(string strCommandName)
{
Boolean Blnflg=false;
try
{
<%=TableName%> <%=dt.TableName %>_CDO =new <%=TableName%>();
cls<%=dt.TableName %>_DA <%=dt.TableName %>_DA = new cls<%=dt.TableName %>_DA();

if (strCommandName != “Delete”) Load_Data(ref <%=dt.TableName %>_CDO);
if (strCommandName != “Save”) <%=dt.TableName %>_CDO.<%=dt.TableName %>Id = Int64.Parse(ViewState[“<%=dt.TableName %>Id”].ToString());
if (strCommandName != “Delete”)
Blnflg = <%=dt.TableName %>_DA.Save_<%=dt.TableName %>(ref <%=dt.TableName %>_CDO,strCommandName);
else
Blnflg = <%=dt.TableName %>_DA.Delete_<%=dt.TableName %>(ref <%=dt.TableName %>_CDO,strCommandName);
}
catch(Exception ex)
{
Session[“ex”] = ex;
throw new Exception(ex.Message,ex);
}
return Blnflg;
}

// Grid Binding Function
private void bind_grid()
{
try
{
<%=TableName%> <%=dt.TableName %>_CDO =new <%=TableName%>();
cls<%=dt.TableName %>_DA <%=dt.TableName %>_DA = new cls<%=dt.TableName %>_DA();
DataSet return_ds=new DataSet();
return_ds = <%=dt.TableName %>_DA.View_<%=dt.TableName %>(<%=dt.TableName %>_CDO);
ViewState[“table”] = return_ds;
gvHeader.DataSource= return_ds;
gvHeader.DataBind();
}
catch(Exception ex)
{
Session[“ex”] = ex;
throw new Exception(ex.Message,ex);
}
}
// DropDownList  Binding Function
private DropDownList BindListBox(DropDownList ddlList, DataSet ds,string TextFields,string ValueFields)
{
ddlList.DataSource=ds;
ddlList.DataTextField=TextFields;
ddlList.DataValueField=ValueFields;
ddlList.DataBind();
if (ddlList.Items.Count>0)
{
ddlList.SelectedIndex=-1;
}
return ddlList;
}
#endregion
#region “Button Events”
// code for Save Button
protected void btnSave_Click(object sender, System.EventArgs e)
{
Boolean Blnflg=false;
if(btnSave.Text==”Save”)
Blnflg=Common_Switch_Case(“Save”);
else if(btnSave.Text==”Update”)
Blnflg=Common_Switch_Case(“Update”);
try
{
if (Blnflg)
{
lblstatus_msg.Text = ” Record has been saved succesfully”;
lblstatus_msg.ForeColor = System.Drawing.Color.Green;
}
else
{
lblstatus_msg.Text = ” Record Already Exist”;
lblstatus_msg.ForeColor = System.Drawing.Color.Red;
}
pnlTrans.Visible=false;
pnlGrid.Visible=true;
bind_grid();
}
catch(Exception ex)
{
Session[“ex”] = ex;
throw new Exception(ex.Message,ex);
}
}
// code for cancelbox

protected void btnCancel_Click(object sender, System.EventArgs e)
{
try
{
btnCancel.Text=”Cancel”;
lblstatus_msg.Text=””;
pnlTrans.Visible=false;
pnlGrid.Visible=true;
bind_grid();
btnSave.Visible=true;
btnAddNew.Visible = true;
btnAddNew.Visible = false;
}
catch(Exception ex)
{
Session[“ex”] = ex;
throw new Exception(ex.Message,ex);
}
}
// add new button click event
protected void btnAddNew_Click(object sender, System.EventArgs e)
{
try
{
ClearText();
setText(true);
pnlGrid.Visible=false;
pnlTrans.Visible=true;
btnSave.Text=”Save”;
lblstatus_msg.Text=””;
}
catch(Exception ex)
{
Session[“ex”] = ex;
throw new Exception(ex.Message,ex);
}
}
#endregion

#region “Grid Events”

protected void gvHeader_PageIndexChanging(object sender, GridViewPageEventArgs e)
{
gvHeader.PageIndex = e.NewPageIndex;
gvHeader.DataSource = (DataSet)ViewState[“table”];
gvHeader.DataBind();
}

protected void gvHeader_RowDeleting(object sender, GridViewDeleteEventArgs e)
{
try
{
<%
foreach (DataColumn col in dt.PrimaryKey)
{ %>
ViewState[“<%=col.ColumnName %>”] = ((Label)gvHeader.Rows[e.RowIndex].FindControl(“llbl<%=col.ColumnName %>”)).Text.ToString();

ViewState[“<%=col.ColumnName %>”]   = gvHeader.Rows[e.RowIndex].Cells[2].Text.ToString();
<% }
%>
Boolean flg = Common_Switch_Case(“Delete”);
if (flg)
{
lblstatus_msg.Text = “Deleting Sucessfully”;
bind_grid();
}
else
{
lblstatus_msg.Text = “Deleting Error”;
}
}
catch (Exception ex)
{
throw ex;
}
}

protected void gvHeader_SelectedIndexChanged(object sender, EventArgs e)
{
try
{
if (gvHeader.SelectedIndex != -1)
{
<%
foreach (DataColumn col in dt.PrimaryKey)
{ %>
ViewState[“<%=col.ColumnName %>”] = ((Label)gvHeader.SelectedRow.FindControl(“llbl<%=col.ColumnName %>”)).Text.ToString();
ViewState[“<%=col.ColumnName %>”]   = gvHeader.SelectedRow.Cells[2].Text.ToString();
<% }

%>

<%
int i;
i = 3;
foreach (DataColumn col in dt.Columns)
{
%>txt<%=col.ColumnName%>.Text = gvHeader.SelectedRow.Cells[<%=i%>].Text.ToString();
txt<%=col.ColumnName%>.Text = ((Label)gvHeader.SelectedRow.FindControl(“llbl<%=col.ColumnName %>”)).Text.ToString();
<%
i++;
}
%>
pnlGrid.Visible = false;
pnlTrans.Visible = true;
btnSave.Text = “Update”;

}
}
catch (Exception ex)
{
throw ex;
}
}
#endregion

</pre>
</div>
</form>
</body>
</html>

Form Generator

December 12, 2008

<%@ Page Language=”C#” %>

<%@ Import Namespace=”System.Data” %>
<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN” “http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”&gt;

<script runat=”server”  >
//TODO:
// Create an Object of the DataTable You need class for
// Assign Connection string name from Web.config
// Assign Data Set Name
//public aspnetdb.ModulePermissionDataTable dt = new aspnetdb.ModulePermissionDataTable();
User.ApplicationModuleDataTable dt = new User.ApplicationModuleDataTable();

//CodeGenerator.TBL_ITEMPROPERTIESDataTable dt = new CodeGenerator.TBL_ITEMPROPERTIESDataTable();
public string TableName
{
get
{
String tblName = dt.TableName.Replace(“DataTable”, “”);
tblName = “cls”+tblName.Replace(” “, “”)+”_CDO”;
return tblName;
}
}
public string ConnectionStringName = “dbLocalSqlServer”;
public string DataSetName = “CodeGenerator”;
public StringBuilder param = new StringBuilder();
</script>

<html xmlns=”http://www.w3.org/1999/xhtml”&gt;
<head id=”Head1″ runat=”server”>
<title>Untitled Page</title>
</head>
<body>
<form id=”form1″ runat=”server”>
<div> <pre>

&lt;table class=”tablemain”&gt;
&lt;tr&gt;
&lt;td class=”tdtitle”&gt;
&lt;asp:Label ID=”Label5″ runat=”server” CssClass=”title” Text=”<%  dt.TableName.ToString(); %>”&gt;&lt;/asp:Label&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class=”trdetail”&gt;
&lt;td&gt;
&lt;asp:Label ID=”lblstatus_msg” runat=”server” CssClass=”message”&gt;status&lt;/asp:Label&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;asp:Panel ID=”pnlGrid” runat=”server”&gt;
&lt;table class=”tabledetail”&gt;
&lt;tr class=”trnew”&gt;
&lt;td&gt;
&lt;asp:Button ID=”btnAddNew” runat=”server” CssClass=”btn”
Text=”Add” /&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;

&lt;asp:GridView ID=”gvHeader” runat=”server” AllowPaging=”True” AlternatingRowStyle-CssClass=”alterrow”
AutoGenerateColumns=”False” CssClass=”gridview”
<%
foreach (DataColumn col in dt.PrimaryKey)
{  %>
DataKeyNames=”<%=col.ColumnName  %>”
<% }
%>
EmptyDataRowStyle-CssClass=”emptyrow”
FooterStyle-CssClass=”footerrow” HeaderStyle-CssClass=”gvheaderrow”
PageSize=”5″ RowStyle-CssClass=”gvrow” SelectedRowStyle-CssClass=”selectrow” &gt;
&lt;Columns&gt;
&lt;asp:TemplateField HeaderText=”Edit” ShowHeader=”False”&gt;
&lt;ItemTemplate&gt;
&lt;asp:ImageButton ID=”ImageButton2″ runat=”server” AlternateText=”Select” CausesValidation=”False”
CommandName=”Select” ImageUrl=”~/App_Themes/Image/Edit.gif” /&gt;
&lt;/ItemTemplate&gt;
&lt;/asp:TemplateField&gt;
&lt;asp:TemplateField HeaderText=”Delete”&gt;
&lt;ItemTemplate&gt;
&lt;asp:ImageButton ID=”ImageButton1″ runat=”server” AlternateText=”Delete” CausesValidation=”False”
CommandName=”Delete” ImageUrl=”~/App_Themes/Image/Delete.gif”   /&gt;
&lt;/ItemTemplate&gt;
&lt;/asp:TemplateField&gt;
<%foreach (DataColumn col in dt.Columns){ %>
&lt;asp:TemplateField HeaderText=”<%=col.ColumnName%>” SortExpression=”<%=col.ColumnName%>”&gt;
&lt;itemtemplate&gt;
&lt;asp:Label ID=”llbl<%=col.ColumnName%>” runat=”server” Text=’&lt;%# Eval(“<%=col.ColumnName%>”) %&gt;’&gt;&lt;/asp:Label&gt;
&lt;/ItemTemplate&gt;
&lt;edititemtemplate&gt;
&lt;asp:TextBox ID=”txt<%=col.ColumnName%>” runat=”server” Text=’&lt;%# Bind(“<%=col.ColumnName%>”) %&gt;’&gt;&lt;/asp:TextBox &gt;
&lt;/EditItemTemplate&gt;
&lt;/asp:TemplateField&gt;
<%}%>
<%foreach (DataColumn col in dt.Columns){ %>
&lt;asp:BoundField DataField=”<%=col.ColumnName%>” HeaderText=”<%=col.ColumnName%>” SortExpression=”<%=col.ColumnName%>” /&gt;
<%}%>
&lt;/Columns&gt;
&lt;EmptyDataTemplate&gt;
&lt;asp:Label ID=”Label6″ runat=”server” Text=”There is not any Application”&gt;&lt;/asp:Label&gt;
&lt;/EmptyDataTemplate&gt;
&lt;FooterStyle CssClass=”footerrow” /&gt;
&lt;EmptyDataRowStyle CssClass=”emptyrow” /&gt;
&lt;RowStyle CssClass=”gvrow” /&gt;
&lt;SelectedRowStyle CssClass=”selectrow” /&gt;
&lt;HeaderStyle CssClass=”gvheaderrow” /&gt;
&lt;AlternatingRowStyle CssClass=”alterrow” /&gt;
&lt;/asp:GridView&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
&lt;asp:Panel&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;asp:Panel ID=”pnlTrans” runat=”server”&gt;
&lt;table id= “tblmain”  class= “tblmain” &gt;
<%foreach (DataColumn col in dt.Columns){ %>
&lt;tr class=”trdetail” &gt;
&lt;td&gt;
&lt;asp:Label ID=”lbl<%=col.ColumnName%>” runat=”server” CssClass=”Lable” Text=”<%=col.ColumnName%>”&gt;&lt;/asp:Label &gt;
&lt;/td&gt;
&lt;td&gt;
&lt;asp:TextBox ID=”txt<%=col.ColumnName%>” runat=”server” CssClass=”text”&gt;&lt;/asp:TextBox &gt;
&lt;/td&gt;
&lt;/tr&gt;        <%}%>
&lt;tr class=”trcentre” &gt;
&lt;td&gt;
&lt;asp:Button ID=”btnSave” runat=”server” CssClass=”btn”   Text=”Save” /&gt;
&lt;asp:Button ID=”btnCancel” runat=”server” CssClass=”btn”  Text=”Cancel” /&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
&lt;asp:Panel&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
</pre>
</div>
</form>
</body>

</html>

DA Generator

December 12, 2008

<%@ Page Language=”C#” %>
<%@ Import Namespace=”System.Data” %>

<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN” “http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”&gt;

<script runat=”server”>
//TODO:
// Create an Object of the DataTable You need class for
// Assign Connection string name from Web.config
// Assign Data Set Name
//public aspnetdb.ModulePermissionDataTable dt = new aspnetdb.ModulePermissionDataTable();
// dsProduction.TBL_PRODUCTION_PROCESS_DETAIL_MACHINEDataTable dt = new dsProduction.TBL_PRODUCTION_PROCESS_DETAIL_MACHINEDataTable();
User.LocationDataTable dt = new User.LocationDataTable();
// CodeGenerator.TBL_ITEMPROPERTIESDataTable dt = new CodeGenerator.TBL_ITEMPROPERTIESDataTable();
public string TableName
{
get
{
String tblName = dt.TableName.Replace(“DataTable”, “”);
tblName = tblName.Replace(” “, “”);
return tblName;
}
}
public string ClassName
{
get
{
String tblName = dt.TableName.Replace(“DataTable”, “”);
tblName =”cls”+ tblName.Replace(” “, “”) + “_DA”;
return tblName;
}
}
public string CDO
{
get
{
String tblName = dt.TableName.Replace(“DataTable”, “”);
tblName = “cls”+tblName.Replace(” “, “”) + “_CDO”;
return tblName;
}
}
public string objCDO
{
get
{
String tblName = dt.TableName.Replace(“DataTable”, “”);
tblName = tblName.Replace(” “, “”) + “_CDO”;
return tblName;
}
}
public string ConnectionStringName = “dbLocalSqlServer”;
public string DataSetName = “CodeGenerator”;
public StringBuilder param = new StringBuilder();
</script>

<html xmlns=”http://www.w3.org/1999/xhtml&#8221; >
<head runat=”server”>
<title>DA Code Generator</title>
</head>
<body>
<form id=”form1″ runat=”server”>
<div>
<pre>
using System;
using System.Text;
using System.Data;
using System.Data.Common;
using System.Data.SqlClient;
using System.Collections;
using IDM.CONN;
using IDM.CDO.Masters;
/*
COMPANY NAME : DILIGENT INFOSYS, AHMEDABAD
PROJECT NAME : ID MANAGEMENT SYSTEM
CREATE BY    : RAJESH B PRAJAPATI
CREATE DATE  : <%= DateTime.Now %>
PURPOSE      : FOR <%= dt.TableName%>
MODIFY BY    :
MODIFY DATE  :
MODIFY PURPOSE :
TABLE USE    : <%= dt.TableName%>
*/
namespace IDM.DA.Masters
{
public class <%=ClassName%>
{
private SqlCommand command;
private Connection conn;
public <%=ClassName%>()
{
//
// TODO: Add constructor logic here
//
}
/*
Function For Getting all Records
*/
public DataSet View_<%=TableName %>(<%=CDO %> <%=objCDO %>)
{
DataSet ds = new DataSet();
try
{
ObjectCreation();
CreateParameters(<%=objCDO %>,ref command,”Select”,”<%=TableName %>_GetList”);
conn.Sql_ExecuteQuery(command,ref ds);
return ds;
}
catch(Exception ex)
{
throw new Exception(ex.Message,ex);
}
}
/*
Function For Save and Update Records
*/
public Boolean Save_<%=TableName %>(ref <%=CDO %> <%=objCDO %>,string command_type)
{
try
{
ObjectCreation();
if (command_type == “Save”)
{
CreateParameters(<%=objCDO %>,ref command,command_type,”<%=TableName %>_Insert”);
if(conn.Sql_ExecuteQuery(command))
{
<%  foreach (DataColumn col in dt.PrimaryKey){ %>
<%=objCDO %>.<%=col.ColumnName %>   = decimal.Parse(( command.Parameters[“@<% =col.ColumnName%>”].Value).ToString());
<% } %>
return true;
}
}
else
{
CreateParameters(<%=objCDO %>,ref command,command_type,”<%=TableName %>_Update”);
if(conn.Sql_ExecuteQuery(command))
return true;
}

}
catch(Exception ex)
{
throw new Exception(ex.Message,ex);
}
return false;
}
/*
Function For Get Record By Id
*/
public Boolean GetEditDeleteView( <%=CDO %> <%=objCDO %>, ref DataSet ds,string str_table)
{
try
{
ObjectCreation();
switch(str_table)
{
case “<%=TableName%>Edit”:
CreateParameters(<%=objCDO %>,ref command,str_table,”<%=TableName %>_Get”);
break;
}
return conn.Sql_ExecuteQuery(command,ref ds,str_table);
}
catch(Exception ex)
{
throw new Exception(ex.Message,ex);
}
}
/*
Function For Delete Record By Id
*/
public Boolean Delete_<%=TableName %>(ref <%=CDO %> <%=objCDO %>,string strCommandName)
{
try
{
ObjectCreation();
CreateParameters(<%=objCDO %>,ref command,strCommandName,”<%=TableName %>_Delete”);
return conn.Sql_ExecuteQuery(command);
}
catch(Exception ex)
{
throw new Exception(ex.Message,ex);
}
}
/*
Function For Create Parameters
*/
public void CreateParameters(<%=CDO %> <%=objCDO %>,ref SqlCommand command,string strCommandName,string strprcname)
{
try
{
command = new SqlCommand();
command.CommandType = CommandType.StoredProcedure;
command.CommandText = strprcname;
command.Connection = conn.Get_Connection();
SqlParameter  Id = new SqlParameter();
if (strCommandName==”Delete” || strCommandName== “<%=TableName%>Edit” || strCommandName==”Update”)
{
<%  foreach (DataColumn col in dt.PrimaryKey){ %>
command.Parameters.Add(“@<% =col.ColumnName%>”, <%=objCDO %>.<%=col.ColumnName %>);
<% } %>
}

if(strCommandName==”Save” || strCommandName==”Update”)
{
if(strCommandName==”Save”)
{   Id= command.Parameters.AddWithValue(“@Id”, SqlDbType.Int);
Id.Direction = ParameterDirection.Output;
}
<% foreach (DataColumn col in dt.Columns){ %>
command.Parameters.Add(“@<% =col.ColumnName%>”, <%=objCDO %>.<%=col.ColumnName %>);
<%} %>
}
if (strCommandName==”Select”  )
{ <%  foreach (DataColumn col in dt.PrimaryKey){ %>
command.Parameters.Add(“@<% =col.ColumnName%>”, <%=objCDO %>.<%=col.ColumnName %>);
<% } %>
}
}
catch(Exception ex)
{
throw new Exception(ex.Message,ex);
}

}
/*
Function For Create Object of Connection Class
*/
public void ObjectCreation()
{
try
{
conn = new IDM.CONN.Connection();
}
catch(Exception ex)
{
throw new Exception(ex.Message,ex);
}
}

}
}
</pre>
</div>
</form>
</body>
</html>

CDO Generator

December 12, 2008

<%@ Page Language=”C#” %>
<%@ Import Namespace=”System.Data” %>
<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN” “http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”&gt;

<script runat=”server”>
//TODO:
// Create an Object of the DataTable You need class for
// Assign Connection string name from Web.config
// Assign Data Set Name
//public aspnetdb.ModulePermissionDataTable dt = new aspnetdb.ModulePermissionDataTable();

User.EmployeeDataTable dt = new User.EmployeeDataTable();

public string TableName
{
get
{
String tblName = dt.TableName.Replace(“DataTable”, “”);
tblName = “cls”+tblName.Replace(” “, “”)+”_CDO”;
return tblName;
}
}
public string ConnectionStringName = “dbLocalSqlServer”;
public string DataSetName = “CodeGenerator”;
public StringBuilder param = new StringBuilder();
</script>
<html xmlns=”http://www.w3.org/1999/xhtml&#8221; >
<head runat=”server”>
<title>Untitled Page</title>
</head>
<body>
<form id=”form1″ runat=”server”>
<div>
<pre>
using System;
using System.Data;
using System.Data.SqlClient;
using System.Collections;
/*
COMPANY NAME        : DILIGENT INFOSYS, AHMEDABAD
PROJECT NAME        : ID MANAGEMENT SYSTEM
CREATE BY           : RAJESH B PRAJAPATI
CREATE DATE         : <%= DateTime.Now %>
PURPOSE             : FOR <%= dt.TableName%>
MODIFY BY           :
MODIFY DATE         :
MODIFY PURPOSE      :
*/
namespace IDM.CDO.Masters
{
public class <%=TableName%>
{
<%
foreach (DataColumn col in dt.Columns)
{
%>
private <%=col.DataType.Name %> _<%=col.ColumnName%>;
public <%=col.DataType.Name %> <%=col.ColumnName%>
{
get{  return _<%=col.ColumnName%>; }
set{ _<%=col.ColumnName%>=value;   }
}
<%
}
%>
}
}
</pre>
</div>
</form>
</body>
</html>

Drop Down Selected Value Setting

December 12, 2008

ddlITOwner.SelectedIndex = ddlITOwner.Items.IndexOf(ddlITOwner.Items.FindByValue(ds.Tables[0].Rows[0][“LocationITOwnerID”].ToString()));

Hello world!

December 12, 2008

Welcome to WordPress.com. This is your first post. Edit or delete it and start blogging!