Click here to Skip to main content
15,881,715 members
Home / Discussions / ASP.NET
   

ASP.NET

 
AnswerRe: Help for MSMQ Pin
kubben16-May-07 3:29
kubben16-May-07 3:29 
GeneralRe: Help for MSMQ Pin
Glenn D'souza16-May-07 19:26
Glenn D'souza16-May-07 19:26 
GeneralRe: Help for MSMQ Pin
kubben17-May-07 4:54
kubben17-May-07 4:54 
GeneralRe: Help for MSMQ Pin
Glenn D'souza17-May-07 18:21
Glenn D'souza17-May-07 18:21 
GeneralRe: Help for MSMQ Pin
kubben18-May-07 1:55
kubben18-May-07 1:55 
Questionquest Pin
jinovv16-May-07 1:04
jinovv16-May-07 1:04 
AnswerRe: quest Pin
N a v a n e e t h16-May-07 2:28
N a v a n e e t h16-May-07 2:28 
AnswerRe: quest Pin
tonymathewt16-May-07 18:41
professionaltonymathewt16-May-07 18:41 
Suppose you have the required records in a datatable dt, you only need to iterate the row index keeping the column index constant.
The rows index value needs to be stored into a hidden field after each iteration. Below is the C# code for the default.aspx for displaying the records.
<br />
using System;<br />
using System.Data;<br />
using System.Web;<br />
using System.Web.UI;<br />
using System.Web.UI.WebControls;<br />
<br />
public partial class _Default : System.Web.UI.Page <br />
{<br />
    Cls_DBtier Cls_DBtierobj = new Cls_DBtier();<br />
    int i = 0;<br />
    DataTable dt;<br />
    protected void Page_Load(object sender, EventArgs e)<br />
    {<br />
        <br />
        Cls_DBtierobj.mvar_DBConnectionstring = Application["Connection_String"].ToString();<br />
        Cls_DBtierobj.OpenConnection();<br />
        dt = Cls_DBtierobj.getNames();<br />
        i = dt.Rows.Count;<br />
        Cls_DBtierobj.CloseConnection();<br />
        LblNames.Text = dt.Rows[0][0].ToString();<br />
        <br />
    }<br />
    protected void BtnNxt_Click(object sender, EventArgs e)<br />
    {<br />
        int index = Convert.ToInt32(HidIndex.Value);<br />
        if (index < i-1)<br />
        {<br />
            index = index + 1;<br />
            HidIndex.Value = index.ToString();<br />
            LblNames.Text = dt.Rows[index][0].ToString();<br />
        }<br />
    }<br />
}<br />


HidIndex is the hidden field, LblNames is the label for displaying the records. And BtnNxt is the button display the next record.

Cls_DBtier is class file. Below is the code for it.
<br />
using System;<br />
using System.Data;<br />
using System.Data.SqlClient;<br />
using System.Web;<br />
using System.Web.UI;<br />
using System.Web.UI.WebControls;<br />
using System.Web.UI.WebControls.WebParts;<br />
<br />
public class Cls_DBtier<br />
{<br />
    public string mvar_DBConnectionstring;<br />
    SqlConnection conn;<br />
    public void OpenConnection()<br />
    {<br />
        conn = new SqlConnection(mvar_DBConnectionstring);<br />
    }<br />
    public void CloseConnection()<br />
    {<br />
        conn.Close();<br />
    }<br />
    public SqlCommand ReturnSqlCommand(string sqlStmt)<br />
    {<br />
        SqlCommand Cmd;<br />
        try<br />
        {<br />
            Cmd = new SqlCommand();<br />
            Cmd.Connection = conn;<br />
            Cmd.CommandType = CommandType.Text;<br />
            Cmd.CommandText = sqlStmt;<br />
            return Cmd;<br />
        }<br />
        finally<br />
        {<br />
            Cmd = null;<br />
        }<br />
    }<br />
    public DataTable getNames()<br />
    {<br />
        string stt = "SELECT ename FROM employee";<br />
        SqlDataAdapter SAdaptor;<br />
        SqlCommand Cmd;<br />
        DataSet ds=new DataSet();<br />
        DataTable dt;<br />
        try<br />
        {<br />
            Cmd=ReturnSqlCommand(stt);<br />
            SAdaptor = new SqlDataAdapter(Cmd);<br />
            SAdaptor.Fill(ds);<br />
            dt = ds.Tables[0];<br />
            return dt;<br />
        }<br />
        finally<br />
        {<br />
            stt = null;<br />
            SAdaptor = null;<br />
            Cmd = null;<br />
            ds = null;<br />
            dt = null;<br />
        }<br />
    }<br />
}<br />

Questionasp.net through c# dropdown list data attachment question Pin
Smrutiranjandebata16-May-07 0:57
Smrutiranjandebata16-May-07 0:57 
AnswerRe: asp.net through c# dropdown list data attachment question Pin
gauthee16-May-07 1:10
gauthee16-May-07 1:10 
AnswerRe: asp.net through c# dropdown list data attachment question Pin
Sylvester george16-May-07 1:52
Sylvester george16-May-07 1:52 
Questionaccess row number OnCheckedChanged inside gridView [modified] Pin
CandyMe16-May-07 0:49
CandyMe16-May-07 0:49 
AnswerRe: access row number OnCheckedChanged inside gridView Pin
Harini N K16-May-07 1:50
Harini N K16-May-07 1:50 
GeneralRe: access row number OnCheckedChanged inside gridView Pin
CandyMe17-May-07 21:11
CandyMe17-May-07 21:11 
QuestioniFrame Problem Pin
varshavmane16-May-07 0:42
varshavmane16-May-07 0:42 
QuestionHow to Deploy ASP.NET Application Pin
Jats_4ru16-May-07 0:02
Jats_4ru16-May-07 0:02 
AnswerRe: How to Deploy ASP.NET Application Pin
Jaiprakash M Bankolli16-May-07 0:15
Jaiprakash M Bankolli16-May-07 0:15 
GeneralRe: How to Deploy ASP.NET Application Pin
Jats_4ru16-May-07 0:54
Jats_4ru16-May-07 0:54 
GeneralRe: How to Deploy ASP.NET Application Pin
Jaiprakash M Bankolli16-May-07 2:39
Jaiprakash M Bankolli16-May-07 2:39 
GeneralRe: How to Deploy ASP.NET Application Pin
Jats_4ru17-May-07 0:27
Jats_4ru17-May-07 0:27 
QuestionLimelight Server Pin
Rahul Babu15-May-07 23:08
Rahul Babu15-May-07 23:08 
Questionfile dialog filter Pin
Amr M. K.15-May-07 22:46
Amr M. K.15-May-07 22:46 
AnswerRe: file dialog filter Pin
N a v a n e e t h15-May-07 22:53
N a v a n e e t h15-May-07 22:53 
GeneralRe: file dialog filter Pin
Amr M. K.15-May-07 23:07
Amr M. K.15-May-07 23:07 
AnswerRe: file dialog filter Pin
badgrs15-May-07 23:48
badgrs15-May-07 23:48 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.