freelanceprogrammers.org Forum Index » ASP

asp.net c# Question NEED HELP!!!


View user's profile Post To page top
les_claypoo1 Posted: Tue Jan 11, 2005 4:17 am


Joined: 05 Jan 2005

Posts: 6
asp.net c# Question NEED HELP!!!
I want to display on the current aspx page the database that I am
currently loading... I have my code listed below and I marked it
where I would like to send an output to the webpage with the current
database I am on. I want to make it like an install file where it
zooms through the files it is copying over really quick. I tried
setting up a label and assigning its text value to the new strFile
but it doesn`t refresh. Any help would be great!!! Seems like it
should be easy to me but I can`t find any help.
-tom


void butTable_Click(object sender, EventArgs e)
{
ListItemCollection licCollection = new ListItemCollection();

strTable = @"<table bordercolor=black cellspacing=1
cellpadding=1 ";
strTable += @"bgcolor=white border=1><theader><tr><td>Branch";
int intSelected = 0;
for(int iIndex = 0; iIndex < lstFields.Items.Count; iIndex++)
{
if (lstFields.Items[iIndex].Selected)
{
licCollection.Add(lstFields.Items[iIndex]);
strTable += @"</td><td>" + licCollection
[intSelected].ToString();
intSelected++;
}//end if the item is Selected
}//for loop to go through all the items in listbox

strTable += @"</td></tr></theader><tbody>";
//strArrayBranches.Length
for (int currentBranch= 0; currentBranch <
strArrayBranches.Length; currentBranch++)
{
strFile = "tsecurit." + strArrayBranches[currentBranch]
+ ".mdb;";
//string DbLocation = Server.MapPath(file);
strConnection = "Provider=Microsoft.Jet.OLEDB.4.0; Ole DB
Services=-4; ";
strConnection += @"Data Source=" + strFile;
**********************Display strFile**************************
**************************RIGHT HERE***************************
***************************************************************
strSelectedTable = lstTables.SelectedItem.Value;
strSQL = "SELECT * FROM " + strSelectedTable;
OleDbConnection objConnection = new OleDbConnection
(strConnection);
OleDbCommand objCommand = new OleDbCommand(strSQL,
objConnection);
OleDbDataReader objDataReader = null;
try
{
objConnection.Open();
objDataReader = objCommand.ExecuteReader();
while (objDataReader.Read() == true)
{
intBranch = Convert.ToInt32(strArrayBranches
[currentBranch]);
strTable += @"<tr><td>"+intBranch;

for (int z = 0; z < licCollection.Count; z++)
{
strTable += @"</td><td>"+objDataReader
[(licCollection[z].ToString())].ToString();
}//end for loop
strTable += @"</td></tr>";
}//end while loop
objDataReader.Close();
objConnection.Close();
}//end try
catch (Exception ex)
{
strErrors += "<br />Failed to establish a connecion
with " + strFile;
}//end catch
}//end for loop
strTable += @"</tbody></table>";
Session["sesTable"] = strTable + strErrors;
Server.Transfer("table.aspx");
//lblTable.Text = strTable;
}//end butTable_Click method
Reply with quote
Send private message
View user's profile Post To page top
charlesmarkc... Posted: Tue Jan 11, 2005 4:22 am


Joined: 07 Jan 2006

Posts: 63
asp.net c# Question NEED HELP!!!
http://www.daveandal.net/books/6744/samples.aspx
has what you want.

Look at progress samples.


On Mon, 10 Jan 2005 22:17:48 -0000, les_claypoo1
<thomasgkrier@...> wrote:
>
> I want to display on the current aspx page the database that I am
> currently loading... I have my code listed below and I marked it
> where I would like to send an output to the webpage with the current
> database I am on. I want to make it like an install file where it
> zooms through the files it is copying over really quick. I tried
> setting up a label and assigning its text value to the new strFile
> but it doesn`t refresh. Any help would be great!!! Seems like it
> should be easy to me but I can`t find any help.
> -tom
>
>
> void butTable_Click(object sender, EventArgs e)
> {
> ListItemCollection licCollection = new ListItemCollection();
>
> strTable = @"<table bordercolor=black cellspacing=1
> cellpadding=1 ";
> strTable += @"bgcolor=white border=1><theader><tr><td>Branch";
> int intSelected = 0;
> for(int iIndex = 0; iIndex < lstFields.Items.Count; iIndex++)
> {
> if (lstFields.Items[iIndex].Selected)
> {
> licCollection.Add(lstFields.Items[iIndex]);
> strTable += @"</td><td>" + licCollection
> [intSelected].ToString();
> intSelected++;
> }//end if the item is Selected
> }//for loop to go through all the items in listbox
>
> strTable += @"</td></tr></theader><tbody>";
> //strArrayBranches.Length
> for (int currentBranch= 0; currentBranch <
> strArrayBranches.Length; currentBranch++)
> {
> strFile = "tsecurit." + strArrayBranches[currentBranch]
> + ".mdb;";
> //string DbLocation = Server.MapPath(file);
> strConnection = "Provider=Microsoft.Jet.OLEDB.4.0; Ole DB
> Services=-4; ";
> strConnection += @"Data Source=" + strFile;
> **********************Display strFile**************************
> **************************RIGHT HERE***************************
> ***************************************************************
> strSelectedTable = lstTables.SelectedItem.Value;
> strSQL = "SELECT * FROM " + strSelectedTable;
> OleDbConnection objConnection = new OleDbConnection
> (strConnection);
> OleDbCommand objCommand = new OleDbCommand(strSQL,
> objConnection);
> OleDbDataReader objDataReader = null;
> try
> {
> objConnection.Open();
> objDataReader = objCommand.ExecuteReader();
> while (objDataReader.Read() == true)
> {
> intBranch = Convert.ToInt32(strArrayBranches
> [currentBranch]);
> strTable += @"<tr><td>"+intBranch;
>
> for (int z = 0; z < licCollection.Count; z++)
> {
> strTable += @"</td><td>"+objDataReader
> [(licCollection[z].ToString())].ToString();
> }//end for loop
> strTable += @"</td></tr>";
> }//end while loop
> objDataReader.Close();
> objConnection.Close();
> }//end try
> catch (Exception ex)
> {
> strErrors += "<br />Failed to establish a connecion
> with " + strFile;
> }//end catch
> }//end for loop
> strTable += @"</tbody></table>";
> Session["sesTable"] = strTable + strErrors;
> Server.Transfer("table.aspx");
> //lblTable.Text = strTable;
> }//end butTable_Click method
>
>
>
>
>
> ________________________________
> Yahoo! Groups Links
>
> To visit your group on the web, go to:
> http://groups.yahoo.com/group/AspNetAnyQuestionIsOk/
>
> To unsubscribe from this group, send an email to:
> AspNetAnyQuestionIsOk-unsubscribe@yahoogroups.com
>
> Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
Reply with quote
Send private message
View user's profile Post To page top
les_claypoo1 Posted: Tue Jan 11, 2005 5:01 am


Joined: 05 Jan 2005

Posts: 6
asp.net c# Question NEED HELP!!!
Somebody sent me here before. It should help and probably would but
this would take me a long time to figure out what is going on. I am
looking for a simpler solution.

--- In AspNetAnyQuestionIsOk@yahoogroups.com, Charles Carroll
<911@l...> wrote:
> http://www.daveandal.net/books/6744/samples.aspx
> has what you want.
>
> Look at progress samples.
>
>
> On Mon, 10 Jan 2005 22:17:48 -0000, les_claypoo1
> <thomasgkrier@h...> wrote:
> >
> > I want to display on the current aspx page the database that I
am
> > currently loading... I have my code listed below and I marked
it
> > where I would like to send an output to the webpage with the
current
> > database I am on. I want to make it like an install file where
it
> > zooms through the files it is copying over really quick. I
tried
> > setting up a label and assigning its text value to the new
strFile
> > but it doesn`t refresh. Any help would be great!!! Seems like
it
> > should be easy to me but I can`t find any help.
> > -tom
> >
> >
> > void butTable_Click(object sender, EventArgs e)
> > {
> > ListItemCollection licCollection = new ListItemCollection();
> >
> > strTable = @"<table bordercolor=black cellspacing=1
> > cellpadding=1 ";
> > strTable += @"bgcolor=white
border=1><theader><tr><td>Branch";
> > int intSelected = 0;
> > for(int iIndex = 0; iIndex < lstFields.Items.Count; iIndex++)
> > {
> > if (lstFields.Items[iIndex].Selected)
> > {
> > licCollection.Add(lstFields.Items[iIndex]);
> > strTable += @"</td><td>" + licCollection
> > [intSelected].ToString();
> > intSelected++;
> > }//end if the item is Selected
> > }//for loop to go through all the items in listbox
> >
> > strTable += @"</td></tr></theader><tbody>";
> > //strArrayBranches.Length
> > for (int currentBranch= 0; currentBranch <
> > strArrayBranches.Length; currentBranch++)
> > {
> > strFile = "tsecurit." + strArrayBranches[currentBranch]
> > + ".mdb;";
> > //string DbLocation = Server.MapPath(file);
> > strConnection = "Provider=Microsoft.Jet.OLEDB.4.0; Ole
DB
> > Services=-4; ";
> > strConnection += @"Data Source=" + strFile;
> > **********************Display strFile**************************
> > **************************RIGHT HERE***************************
> > ***************************************************************
> > strSelectedTable = lstTables.SelectedItem.Value;
> > strSQL = "SELECT * FROM " + strSelectedTable;
> > OleDbConnection objConnection = new OleDbConnection
> > (strConnection);
> > OleDbCommand objCommand = new OleDbCommand(strSQL,
> > objConnection);
> > OleDbDataReader objDataReader = null;
> > try
> > {
> > objConnection.Open();
> > objDataReader = objCommand.ExecuteReader();
> > while (objDataReader.Read() == true)
> > {
> > intBranch = Convert.ToInt32(strArrayBranches
> > [currentBranch]);
> > strTable += @"<tr><td>"+intBranch;
> >
> > for (int z = 0; z < licCollection.Count; z++)
> > {
> > strTable += @"</td><td>"+objDataReader
> > [(licCollection[z].ToString())].ToString();
> > }//end for loop
> > strTable += @"</td></tr>";
> > }//end while loop
> > objDataReader.Close();
> > objConnection.Close();
> > }//end try
> > catch (Exception ex)
> > {
> > strErrors += "<br />Failed to establish a connecion
> > with " + strFile;
> > }//end catch
> > }//end for loop
> > strTable += @"</tbody></table>";
> > Session["sesTable"] = strTable + strErrors;
> > Server.Transfer("table.aspx");
> > //lblTable.Text = strTable;
> > }//end butTable_Click method
> >
> >
> >
> >
> >
> > ________________________________
> > Yahoo! Groups Links
> >
> > To visit your group on the web, go to:
> > http://groups.yahoo.com/group/AspNetAnyQuestionIsOk/
> >
> > To unsubscribe from this group, send an email to:
> > AspNetAnyQuestionIsOk-unsubscribe@yahoogroups.com
> >
> > Your use of Yahoo! Groups is subject to the Yahoo! Terms of
Service.
Reply with quote
Send private message
Post new topic Reply to topic
Display posts from previous:   
 

All times are GMT
Page 1 of 1
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Freelace Website Designer - Customer web design and software building.
Booking Calendar - reservation calendar script
Land Surveying - total station instruments and equipments
China Wholesale - Electronics Products
Character Studio - Tutorials and Help