Click here to Skip to main content
15,923,120 members
Home / Discussions / ASP.NET
   

ASP.NET

 
QuestionPerforming the equivalent of two response.X functions in the same click event Pin
_Damian S_24-Oct-07 16:39
professional_Damian S_24-Oct-07 16:39 
AnswerRe: Performing the equivalent of two response.X functions in the same click event Pin
Guffa29-Oct-07 14:20
Guffa29-Oct-07 14:20 
GeneralRe: Performing the equivalent of two response.X functions in the same click event Pin
_Damian S_29-Oct-07 14:30
professional_Damian S_29-Oct-07 14:30 
AnswerRe: Performing the equivalent of two response.X functions in the same click event Pin
Guffa30-Oct-07 4:25
Guffa30-Oct-07 4:25 
GeneralRe: Performing the equivalent of two response.X functions in the same click event Pin
_Damian S_30-Oct-07 20:17
professional_Damian S_30-Oct-07 20:17 
QuestionJavaScript Not Running Pin
kenexcelon24-Oct-07 13:20
kenexcelon24-Oct-07 13:20 
AnswerRe: JavaScript Not Running Pin
Christian Graus24-Oct-07 13:26
protectorChristian Graus24-Oct-07 13:26 
QuestionKeep DAta uptdated Pin
crazy friend24-Oct-07 12:18
crazy friend24-Oct-07 12:18 
Hello, i have a real time data problem,

Let me explain,

Im building a web site, in order to user acces to check the status of an application, ive already have the process to keep update the data, ive an arraylist, where I put the modified data , the a timer updates the data, so, I have a data table … a static data table, so what I do , I just modify the data, with the editrow( ) function, then I pass the object to a dataview so the paga can be repainted, so everything goes well to that point.

Why I have static table, ok, first cause my fuction is static.. so.. then cause I need that the data be the same for other users, so when I run the page on a server all the users see the same data on the table.

Ok the problem comes when each user initializes the page, cause, the initialize process “try” does the process of adding colums to the data table , colums that already exist, so a error message pop ups, telling me that it cant be created again, ok so… what im doing,

First I cant use a non static data table, cause each time a user enters the page, it wont have any data, … so, im trying to have a non static data table, then when I get a modification on the data I use this, (Im passing the structure from the non static data table to the static)
DataTable static StaticDatatable =new DataTable()
DataTable static NonStaticDatatable =new DataTable()

if (loadatfirst == 0)
{
DtMotor.Columns.Add(new DataColumn("Numero", typeof(string)));
DtMotor.Columns.Add(new DataColumn("Nombre", typeof(string)));
DtMotor.Columns.Add(new DataColumn("Estado", typeof(string)));
DtMotor.Columns.Add(new DataColumn("RPM", typeof(string)));
DtMotor.Columns.Add(new DataColumn("UniqDevice", typeof(string)));
loadatfirst = 1;
StaticDatatable = NonStaticDatatable ;
}

so, at this point it seems to be no problem, so I have a static function that adds information to the StaticDatatable

StaticDatarow = StaticDatatable.NewRow();
StaticDatarow [0] = numeromotor.ToString();
StaticDatarow [1] = d.FriendlyName;
StaticDatarow.Rows.Add(StaticDatatable);

The problem comes, after this… Im trying to pass the data to the non static table just even up the to tables with a simple

NonStaticDatatable = StaticDatatable;

So if a new user enters the page, the nonstatictable creates as a new object but when its going to repaint the info, pass the information to the static, so if its repeted it doesn’t add in the first place, so it supposed that the only data it would be the new and the old, but no repeted data,

But when a new users enter nothing happened, the data table is empty, and I don’t know why…

[code]
public static DataTable StMotor = new DataTable();
public static DataRow SrMotor;
public DataTable DtMotor = new DataTable();
public DataRow DrMotor;

public void generategrids()
{
MotorsGrid.DataSource = CreateDataMotor();
MotorsGrid.DataBind();
}

protected ICollection CreateDataMotor()
{
if (loadatfirst == 0)
{
DtMotor.Columns.Add(new DataColumn("Numero", typeof(string)));
DtMotor.Columns.Add(new DataColumn("Nombre", typeof(string)));
DtMotor.Columns.Add(new DataColumn("Estado", typeof(string)));
DtMotor.Columns.Add(new DataColumn("RPM", typeof(string)));
loadatfirst = 1;
StMotor = DtMotor;
}
/*
StMotor.Columns.Add(new DataColumn("Numero", typeof(string)));
StMotor.Columns.Add(new DataColumn("Nombre", typeof(string)));
StMotor.Columns.Add(new DataColumn("Estado", typeof(string)));
StMotor.Columns.Add(new DataColumn("RPM", typeof(string)));
StMotor.Columns.Add(new DataColumn("UniqDevice", typeof(string)));
* */


DataView dv = new DataView(DtMotor);
return dv;
}


private static void FuncMotor()
{
bool repetido= false;
for (int i = 0; i <= numeromotor-1; i++)
{
if ((string)d.UniqueDeviceName == (string)CpSMotor.MotorUnique[i])
{
repetido = true;
}
}
if (repetido == false)
{
numeromotor++;
SrMotor = StMotor.NewRow();
SrMotor[0] = numeromotor.ToString();
SrMotor[1] = “info”;
SrMotor[2] = “info”
SrMotor[3] = “info”; //test
SrMotor[4] = “info”;
StMotor.Rows.Add(SrMotor);
}
}

protected void refrescar_Click(Object sender, EventArgs e)
{
//DtMotor.Merge(StMotor, false);
DtMotor = StMotor;

for (int i = 0; i < DtMotor.Rows.Count; i++)
{
DtMotor.Rows[i].BeginEdit();
DtMotor.Rows[i][2] = “info2”
DtMotor.Rows[i][3] = “info2”
}
DataView dv = new DataView(DtMotor);
MotorsGrid.DataSource = dv;
MotorsGrid.DataBind();

}

[/code]

the issue is, I need the data form the code behind object, be the same for al the users, cause the page automaticlly request for new information throug a java timer, so when a modify data appears the code behind update on the data table, and pass it to the dataview in order to be repainted when the request comes.
AnswerRe: Keep DAta uptdated [modified] Pin
Pete O'Hanlon25-Oct-07 2:57
mvePete O'Hanlon25-Oct-07 2:57 
Questionhow to use timer control in ASP.NET 2005 Pin
joshi reddy podduturi24-Oct-07 10:15
joshi reddy podduturi24-Oct-07 10:15 
AnswerRe: how to use timer control in ASP.NET 2005 Pin
crazy friend24-Oct-07 12:34
crazy friend24-Oct-07 12:34 
GeneralRe: how to use timer control in ASP.NET 2005 Pin
joshi reddy podduturi24-Oct-07 16:32
joshi reddy podduturi24-Oct-07 16:32 
GeneralRe: how to use timer control in ASP.NET 2005 Pin
Christian Graus24-Oct-07 20:51
protectorChristian Graus24-Oct-07 20:51 
AnswerRe: how to use timer control in ASP.NET 2005 Pin
Christian Graus24-Oct-07 13:00
protectorChristian Graus24-Oct-07 13:00 
GeneralRe: how to use timer control in ASP.NET 2005 Pin
Not Active24-Oct-07 14:39
mentorNot Active24-Oct-07 14:39 
GeneralRe: how to use timer control in ASP.NET 2005 Pin
Christian Graus24-Oct-07 20:48
protectorChristian Graus24-Oct-07 20:48 
Questionabout .net Pin
mirchi_tikhi24-Oct-07 9:13
mirchi_tikhi24-Oct-07 9:13 
AnswerRe: about .net Pin
Deepak Nigam24-Oct-07 9:50
Deepak Nigam24-Oct-07 9:50 
Questionrequired project Pin
mirchi_tikhi24-Oct-07 9:07
mirchi_tikhi24-Oct-07 9:07 
AnswerRe: required project Pin
Malcolm Smart24-Oct-07 9:56
Malcolm Smart24-Oct-07 9:56 
JokeRe: required project Pin
Mircea Grelus24-Oct-07 12:50
Mircea Grelus24-Oct-07 12:50 
AnswerRe: required project Pin
Christian Graus24-Oct-07 13:06
protectorChristian Graus24-Oct-07 13:06 
QuestionSession Problem Pin
Malleswar123424-Oct-07 8:25
Malleswar123424-Oct-07 8:25 
AnswerRe: Session Problem Pin
Felipe Dalorzo24-Oct-07 10:10
Felipe Dalorzo24-Oct-07 10:10 
GeneralRe: Session Problem Pin
Malleswar123424-Oct-07 21:39
Malleswar123424-Oct-07 21:39 

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.