Thursday, August 24, 2006

Thank You For Visiting My Blog

Thank You Very Much for visiting my blog,

There are 155 visitors in last month who visit my blog. It is such
a over whelming experience that you work is recognized in such big way.

I want your valuable comments on my post to make it better. So please put
your comments for the post directly.

You can also put your valuable comments in my guest book:

here are the links:


Post Your Comments
Share:

Sql Server Escape Sequence

Some times we are required to put '(Quotation Mark) in our sql stored procedure query.But '(Quotation Mark) will use for operation in sql server stored procedure. You can use escape sequence here.
for example you want to put 'jalpesh' in stored procedure then you should give
print '''jalpesh'''
here first two quota ion mark counted as escape sequence and then the third ' are counted as character.
Share:
Thursday, August 10, 2006

Starting Point of auto number fields in Microsoft Access

Auto Number Field handy things in Microsoft access.It will
automatically increase the filed value as records are
inserted. Developer don't have to care for it. By default
auto number field start with the zero but sometimes we
required to start auto number with rather than zero.

We can do it by creating the append query. Following
are the procedure for creating our own starting point
in the Microsoft access.

-First copy the auto number field table with another
table name.

-Now change the auto number field to the number field
in the newly created make sure that long integer is there.

-Now insert a record with starting point in newly created
table. For example you want to start with 300 then
insert with 300.

-Create a query from query designer of access
select all the field of newly created table.

-Go to the query menu select append query and into
destination table give original table name.

-Append it

- Delete newly created table.

That's it. You have created your own starting point.
now auto number starts with 300.

Happy Programming...
Share:

Paging in Datalist or Repeater Control In ASP.NET

==============================================
HTML of Datalist
==============================================
<asp:datalist id="dsList" runat="server" width=100%>

<ItemTemplate>

<%#DataBinder.Eval(Container.DataItem, "ID").ToString()%>

<%#DataBinder.Eval(Container.DataItem, "Name").ToString()%>

</ItemTemplate>

</asp:datalist>



<table width="100%" border="0" align="Center">

<tr>

<td><asp:LinkButton id="lnkPrevious" runat="server">

</asp:LinkButton>

</td>

<td><asp:LinkButton id="lnkNext" runat="server">>

</asp:LinkButton>

</td>

</tr>

</table>
===============================================
Server Side Coding : VB.NET
===============================================

Dim Start As Integer
Dim dbCon As SqlConnection
Dim Adpt As SqlDataAdapter
Dim dtUser As DataSet

Private Sub Page_Load(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles MyBase.Load

If Not Page.IsPostBack Then
ViewState("Start") = 0
BindData()
End If


End Sub

Sub BindData()

dbCon = New SqlConnection("server=localhost;uid=sa;
pwd=;database=user")
Adpt = New SqlDataAdapter("Select * from user ", dbCon)
dtUser = New DataSet
Start = ViewState("Start")
ViewState("Size") = 14
Adpt.Fill(dtUser, Start, ViewState("Size"), "user")
dsList.DataSource = dtUser
dsList.DataBind()

End Sub



Private Sub lnkPrevious_Click(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles lnkPrevious.Click

Start = ViewState("Start")- ViewState("Size")
ViewState("Start") = Start
If Start <= 0 Then ViewState("Start") = 0 End If BindData() End Sub Private Sub lnkNext_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles lnkNext.Click Dim count As Integer = dsList.Items.Count Start = ViewState("Start") + ViewState("Size") ViewState("Start") = Start If count <>
=====================================================
Server Side Coding: c#
=====================================================
int Start ;
SqlConnection dbCon ;
SqlDataAdapter Adpt ;
DataSet dtUser ;
private void Page_Load(object sender, System.EventArgs e)
{
if(!Page.IsPostBack )
{
ViewState["Start"] = 0;
BindData();
}
}
void BindData()
{
dbCon = new SqlConnection("server=localhost;uid=sa;
pwd=;database=user");
Adpt = new SqlDataAdapter("Select * from user", dbCon);
dtUser = new DataSet();
Start = (int)ViewState["Start"];
ViewState["Size"] = 14;
Adpt.Fill(dtUser, Start,(int) ViewState["Size"], "user");
dsList.DataSource = dtUser;
dsList.DataBind();
}

private void lnkPrevious_Click(object sender, System.EventArgs e)
{
Start = (int) ViewState["Start"] -(int) ViewState["Size"];
ViewState["Start"] = Start;
if (Start <= 0 ) { ViewState["Start"] = 0; } BindData(); } private void lnkNext_Click(object sender, System.EventArgs e) { int count = dsList.Items.Count; Start = (int) ViewState["Start"]+(int) ViewState["Size"]; ViewState["Start"] = Start; if ( count < (int)ViewState["Size"] ) { ViewState["Start"] = (int)ViewState["Start"] - (int)ViewState["Size"]; } BindData(); }
Share:
Monday, August 7, 2006

Crystal Report : Add Comand:

Some times we need only a single field from a particular table while creating a report.Which sometimes has no relationship with others.To do this So many peoples are importing table and use a one field.

Crystal Reports 9.0 onwards give us a facility called command which return the fields as you have specified in the command query.

To do this go to the database expert and select add command this will open a query window there and put the simple query and it will return fields you have specified in the query analyser.

It's very simple.Happy Programming....
Share:

Support this blog-Buy me a coffee

Buy me a coffeeBuy me a coffee
Search This Blog
Subscribe to my blog

  

My Mvp Profile
Follow us on facebook
Blog Archive
Total Pageviews