Click here to Skip to main content
15,888,062 members
Home / Discussions / C#
   

C#

 
AnswerRe: Requiring registration code Pin
MavKilla15-Nov-08 1:34
MavKilla15-Nov-08 1:34 
QuestionA question about s singleton applicaiton? Pin
Jason_Shen14-Nov-08 15:14
Jason_Shen14-Nov-08 15:14 
AnswerRe: A question about s singleton applicaiton? Pin
Giorgi Dalakishvili15-Nov-08 0:35
mentorGiorgi Dalakishvili15-Nov-08 0:35 
AnswerRe: A question about s singleton applicaiton? Pin
Wendelius15-Nov-08 0:40
mentorWendelius15-Nov-08 0:40 
GeneralRe: A question about s singleton applicaiton? Pin
Jason_Shen15-Nov-08 3:48
Jason_Shen15-Nov-08 3:48 
GeneralRe: A question about s singleton applicaiton? Pin
Wendelius15-Nov-08 4:13
mentorWendelius15-Nov-08 4:13 
AnswerRe: A question about s singleton applicaiton? Pin
Jason_Shen17-Nov-08 3:27
Jason_Shen17-Nov-08 3:27 
Questionproblem in custom paging.. Pin
kamalesh574314-Nov-08 15:11
kamalesh574314-Nov-08 15:11 
Hi all,
i'm having problem in custom paging using web application..there is an error saying "Input string was not in a correct format."

Here is my coding..
protected void NavigationLink_Click ( Object sender, CommandEventArgs e )
{
switch ( e.CommandName )
{
case "First":
_currentPageNumber = 1;
break;
case "Last":
_currentPageNumber = Int32.Parse(TotalPages.Text);
break;
case "Next":
_currentPageNumber = Int32.Parse(CurrentPage.Text) + 1;
break;
case "Prev":
_currentPageNumber = Int32.Parse(CurrentPage.Text) - 1;
break;
}
BindData();
}


public void BindData()
{
OdbcConnection myconn;
myconn= new OdbcConnection ("DSN=myodbc2;SERVER=localhost;DATABASE=misdb;UID=root;PORT=3306");
OdbcCommand cmd2 = new OdbcCommand("Select * from registration", myconn);
cmd2.CommandType=CommandType.StoredProcedure;

cmd2.Parameters.Add(new OdbcParameter ("@CurrentPage",OdbcType.Numeric,10)).Value=_currentPageNumber;

cmd2.Parameters.Add(new OdbcParameter("@PageSize",OdbcType.Numeric,10)).Value=DataGrid.PageSize;

cmd2.Parameters.Add(new OdbcParameter("@TotalRecords",OdbcType.Numeric,10)).Direction =ParameterDirection.Output;

try
{
myconn.Open();
DataGrid.DataSource=cmd2.ExecuteReader();
DataGrid.DataBind();
}
finally
{
myconn.Close();
}

CurrentPage.Text=_currentPageNumber.ToString();
Double _totalPages = 1;

if ( !Page.IsPostBack )
{
Int32 _totalRecords = (Int32) cmd2.Parameters["@TotalRecords"].Value;
totalPages = _totalRecords / DataGrid.PageSize;
TotalPages.Text =(System.Math.Ceiling(_totalPages)).ToString();
}
else
{
_totalPages = Double.Parse(TotalPages.Text);
}


if ( _currentPageNumber == 1 )
{
PreviousPage.Enabled = false;

if ( _totalPages > 1 )
{
NextPage.Enabled = true;
}
else
{
NextPage.Enabled = false;
}
}
else
{
PreviousPage.Enabled = true;

if ( _currentPageNumber == _totalPages )
{
NextPage.Enabled = false;
}
else
{
NextPage.Enabled = true;
}
}
}

%#&kmpYrlHSGYG5@#($_+!@!(*JASnjshdk,cm_0ashjhdbn@#$!48mkhfbchsh))^%#W%&@YW7wsdfjw789';'][]\`~JKJQ4$!@#~)-HSKS^&*1)JK12@#@$~!1`DFGkqp][]\]?Zas;EWRG%!@~)(^&BVAG

AnswerRe: problem in custom paging.. Pin
Guffa14-Nov-08 18:06
Guffa14-Nov-08 18:06 
GeneralRe: problem in custom paging.. Pin
kamalesh574316-Nov-08 13:30
kamalesh574316-Nov-08 13:30 
GeneralRe: problem in custom paging.. Pin
Guffa16-Nov-08 15:49
Guffa16-Nov-08 15:49 
GeneralRe: problem in custom paging.. Pin
kamalesh574316-Nov-08 16:17
kamalesh574316-Nov-08 16:17 
Questionxml file embedded: can´t save changes Pin
nelsonpaixao14-Nov-08 13:46
nelsonpaixao14-Nov-08 13:46 
AnswerRe: xml file embedded: can´t save changes Pin
Dave Kreskowiak14-Nov-08 16:24
mveDave Kreskowiak14-Nov-08 16:24 
GeneralRe: xml file embedded: can´t save changes Pin
nelsonpaixao15-Nov-08 5:09
nelsonpaixao15-Nov-08 5:09 
QuestionHow to scan barcode without an active focus on a textbox Pin
hafij_cse14-Nov-08 8:58
hafij_cse14-Nov-08 8:58 
AnswerRe: How to scan barcode without an active focus on a textbox Pin
Wendelius14-Nov-08 9:11
mentorWendelius14-Nov-08 9:11 
QuestionForm minimize Pin
netJP12L14-Nov-08 8:55
netJP12L14-Nov-08 8:55 
AnswerRe: Form minimize Pin
Wendelius14-Nov-08 9:08
mentorWendelius14-Nov-08 9:08 
QuestionHow to display different texts with different colors in a textbox Pin
Seraph_summer14-Nov-08 7:55
Seraph_summer14-Nov-08 7:55 
AnswerRe: How to display different texts with different colors in a textbox Pin
Wendelius14-Nov-08 7:57
mentorWendelius14-Nov-08 7:57 
AnswerRe: How to display different texts with different colors in a textbox Pin
Paul Conrad14-Nov-08 8:45
professionalPaul Conrad14-Nov-08 8:45 
Questionone prolem for publishing project Pin
Seraph_summer14-Nov-08 7:48
Seraph_summer14-Nov-08 7:48 
AnswerRe: one prolem for publishing project Pin
sph3rex14-Nov-08 7:58
sph3rex14-Nov-08 7:58 
GeneralRe: one prolem for publishing project Pin
Seraph_summer14-Nov-08 8:01
Seraph_summer14-Nov-08 8:01 

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.