Introduction :
This article show you how you can create Table Of Content In rdlc report . I have written step to fetch page no of the rdlc page .
Step 1.Go In Report >> Report Properties >> Code >>
Step 2. Write Following code in Code .
Public Function GetValue(PageNo As String) As String
Dim path As String = "Test"
Dim Sb As New System.Text.StringBuilder()
Try
If Not String.IsNullOrEmpty(PageNo.Trim().Split("-"C)(1).ToString()) Then
Dim con As String = "Connection String"
Dim Cn As New System.Data.SqlClient.SqlConnection(con)
Cn.Open()
Dim Cmd As New System.Data.SqlClient.SqlCommand("INSERT INTO DATA(NAME) VALUES('" & PageNo & "')", Cn)
Cmd.ExecuteNonQuery()
Cn.Close()
End If
Return path
Catch Exc As System.Exception
Return Exc.Message
End Try
End Function
Step 3. then add following assembly In references :
Page no of Page where textbox8 reside will be insert in database .In these way you can generate Table of Content .Generate One Doc File and merge it with exported Doc File .
Get column values by comma separated in Sql Server
Introduction : In this article i will explain you how to get column's values by comma separated in sql server .
It is very easy to get all values of column in one string as separated by comma .
Query for get comma separated value of column in sql server :
Declare @Description varchar(4000)
select @Description = coalesce(@Description + ',' , '') + Name FROM UserTable
print @Description
Introduction : In this article i will show you how to get all Sundays between two dates in asp.net c# .
Following is function i have written for getting all Sundays between two dates in c# .It is very just you need to add code and you will able get all Sundays between two dates in c# .
Introduction : This article describe you how to find week number from date in c# .I have created one function which return you week number from the date in c# .
C# Code for finding the week number :
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace HamidSite
{
public partial class Test : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
int WeekNo = GetWeeknumber(DateTime.Now);
}
public int GetWeeknumber(DateTime Date)
{
try
{ int iMonth = Date.Month;
int returnNumber = 0;
for (int i = 1; i <= 5; i++)
{
if (iMonth == Date.AddDays(-7 * i).Month)
{ }
else
{
returnNumber = i; break;
}
}
return returnNumber;
}
catch (Exception Exc) { throw Exc; }
}
}
}