|
Why don't use
fname= fname.Replace(" ","_");
MHF
|
|
|
|
|
suppose my xml is
<document type="Sales Invoice" transactions="1">
<imagepath>\\90104-server2\FTP Upload\New Look Retailers Ltd\001;29552;2;240706;150931\00000008.tif
<archiveimagepath>\\s55701\P2D\FTP Archive Redundant\New Look Retailers Ltd\001;29552;2;240706;150931_1009\00000008.tif
<type>Expense
<invoicenumber>6058
<invoicedate>23/05/2006
<invoicetaxpointdate>NOT_FOUND
<currencycode>GBP
<netamount>4957.25
<taxamount>867.52
<grossamount>5824.77
<transaction>
<lineno>1
<orderno>PP31287
<description> ACCOUNT NO: N003 - ORDER NO: PP31287 - LINKED REF NO: CO5701856PL401 - RE: COVENTRY STORE - TO SUPPLY - INTERNAL BRANDING SEGMENTATION WORKS FOR - COVEN -114Y STORE
<quantity>1
<price>4957.25
<nettvalue>4957.25
<taxvalue>
<transaction>
<lineno>1
<orderno>PP31287
<description> ACCOUNT NO: N003 - ORDER NO: PP31287 - LINKED REF NO: CO5701856PL401 - RE: COVENTRY STORE - TO SUPPLY - INTERNAL BRANDING SEGMENTATION WORKS FOR - COVEN -114Y STORE
<quantity>1
<price>4957.25
<nettvalue>4957.25
<taxvalue>
so my master part is Document tag and there could be many detail part like Transaction tag.
so pls help me how could i read this type of master detail xml data .specially detail part in a loop by XmlTextReader.pls help me with source code.
tbhattacharjee
|
|
|
|
|
hi,
how to download file.
i want click event time download,
i am using asp.net1.1,
plz help anyone
thanks
|
|
|
|
|
Not sure I can get your clue...
But one user want to download file, you just give them the url ...
<< >>
|
|
|
|
|
In my application i want do some thing once when page is loaded for first time i put this in
if(!Page.IsPostBack){
/code here
}
BUT this run 2 time when page is loaded why? and How can solve it
MHF
|
|
|
|
|
|
hi ,
can any one help me out writting code for Advanced search in ASP.NET
because i am a fresher .
CDHU
|
|
|
|
|
maybe this is useful
http://www.codeproject.com/aspnet/DotLuceneSearch.asp
MHF
|
|
|
|
|
plz make this difference clear for me
what is the difference between oninit and onload.
i want to make the object only once, but these methods will be called again on button click.
where should i call the object
either in oninit
or in onload
|
|
|
|
|
They are just two events that occur in the beginning of the life cycle of a control.
When you click a button, it will cause a postback. A postback is a request to the server to create a page. When the page is created, all controls in it is created. If you don't create your control in every postback, it would be missing from the page when it loads in the browser.
---
b { font-weight: normal; }
|
|
|
|
|
just put your code into !Page.IsPostBack block....
<< >>
|
|
|
|
|
protected void btnDisplayPopUp_Click(object sender, EventArgs e)
{
Page.RegisterStartupScript("MyPopUpScript", @"window.open('http://server_name/app_name/pop_up_window_page.html');");
}
in aspx page:
<aspx:button runat="server" id="btnDisplayPopUp" onclick="btnDisplayPopUp_Click" text"open="" pop="" up="" window"="">
THANKS buddy, some one has told me this solution for pop-up window.
but
it opens a new page not a pop-up window
means....
not a page like having no menu-bar and no tool-bar.
i just want to have a window like alert on bottom-right corner by e-buudy.com that "you have signed in"
thanks a lot..
|
|
|
|
|
hi Mairy,
Try this.
Dim strScript As String = "" & _
"window.open('webform1.aspx',''," & _
"'height=200;width=200px;left=150;top=100;menubar=no;resizable=yes;scrollbars=no;status=no;titlebar=no;toolbar=no');" & _
""
Response.Write(strScript)
Thomas
|
|
|
|
|
I'll just answer your next question after following Thomas' advice: "Yes, that shows a popup window, but the layout of my page gets all distorted".
That is because you are writing out the script before the doctype tag. That will make the browser ignore the doctype tag, so the page is rendered in Quirks Mode.
Use RegisterStartupScript to add the script to the page.
Also: The second parameter is the name of the window. Use a proper name, or use '_blank' if you want to open a new window.
---
b { font-weight: normal; }
|
|
|
|
|
I have the following html control on asp.net page (2.0):
<input id="ButtonPing" style="width: 91px" type="button" value="Ping" onclick="CallServer2()"/>
and also have the following javascript defined:
<head runat="server">
<title>Get Map</title>
<script language="javascript" type="text/javascript">
function CallServer2()
{
var arg = document.all['DropDownListTrailer'].value;
var context = new Object();
document.getElementById('DivStatus').innerText = "Please Wait ...";
CallServer(arg, context) // AJAX
}
function ReceiveServerData(arg, context)
{
document.getElementById('DivStatus').innerText = arg;
}
</script>
</head>
The above code will only work on Internet Explorer and does not work on Mozilla.
Under Mozilla, when I click the button, the click event is never finished.
Does anyone have the same problem ? I have been fighting this for the last week.
Rookie Programmer
|
|
|
|
|
That is because you are using IE-specific code.
The document.all collection is not part of the standard, and only exists in IE.
---
b { font-weight: normal; }
|
|
|
|
|
Thank you for your help
I comment out all lines except one, but still have the same problem.
function CallServer2()
{
var arg = "xyz" //document.getElementById('DropDownListTrailer').value;
// var context = new Object();
document.getElementById('DivStatus').innerText = "Please Wait ...";
// CallServer(arg, context)
}
Rookie Programmer
|
|
|
|
|
Have you opened the Javascript Console, so that you see any error messages that might come?
---
b { font-weight: normal; }
|
|
|
|
|
This could probably also be in the SQL forum but nevermind.
What i am trying to do is create a generic class for storing my query results. At the moment i have a Database class that i can call an queryDatabase(string queryString) method that i call with SELECT statements. This returns a dataset populated with the query results.
Then in each of my classes such as Player, Item etc (making a web game here) i would do something such as:
Database db = new Database();
DataSet playerResultSet = db.queryDatabase("SELECT name FROM Player WHERE id = " + id);
if (playerResultSet.Tables.Count > 0)
{
DataTable playerTable = playerResultSet.Tables[0];
if (playerTable.Rows.Count > 0)
name = (string)playerTable.Rows[0]["name"];
}
This would give me the name of the playerID that i searched for.
What i am looking to do is to remove the code that i pasted to a separate, generic, class so that my classes such as Player and Item don't have to use DataSets, DataTables etc. I'm wondering if this is possible really since it will have to be generic, which creates problems since i wont know which table has been searched or the rows/columns in it and also the number of results.
So ideally this generic class would have methods to get the number and names of tables/rows or whatever and the values in them.
Has anyone ever had this problem / created a similar class / knows what i'm talking about?
Thanks for the help.
Tony.
|
|
|
|
|
toptone78 wrote: Has anyone ever had this problem / created a similar class / knows what i'm talking about?
I doubt anyone here does. And they will reply with something about ado.net too!
So anyways you can create a player class and enclose it inside generic list
List<PlayerClass>
public class PlayerSort : ICompare
then when sort just pass in a new instance of that class
also populating classes;
lets say you have this
select PlayerName from Players
you create a class like this
public class Players
{
public string PlayerName{ get; set; ... }
}
then using reflection you can store the name you get from a reader
PropertyInfo prop = this.GetType().GetProperty(string name from the read for the column );
prop.SetValue();
this will load your entire object
you can do the same for Updating and Loading with reflection.
So while people are writing all types of code, you only need 4 lines of code to handle all database calls
And ADO.NET sucks by the way. Its bulky, huge, slow, and a waste of resources. <-- I'm sure that will start a good forumn Besides ADO.NET is just a do all IListSource.
And by the way, in c# 3.0 it does this anyways. With the new QLink and XLink. Unless the programmer is from a Java background they dont think this way
Nick
--------------------------------------------------------
1 line of code equals many bugs. So don't write any!!
My mad coder blog
|
|
|
|
|
Well my Database class does not use ADO.NET it uses SqlConnection, SqlCommand and SqlDataAdapter which fills a DataSet.
I'm not sure i really understood your reply, sorry.
|
|
|
|
|
well all of the above is ado.net.
and its faster to use a data reader. it uses a fire hose cursor
--------------------------------------------------------
1 line of code equals many bugs. So don't write any!!
My mad coder blog
|
|
|
|
|
Alright fairy muff. But is it possible to build a generic class like i suggested?
|
|
|
|
|
yeah just build a base class and have all inherit from that
public class GenericClass{}
public class PlayerClass : GenericClass{}
Remember tho classes should have a 1:1 relationship with the database
--------------------------------------------------------
1 line of code equals many bugs. So don't write any!!
My mad coder blog
|
|
|
|
|
and by the way. What I was talking about is loading a database record into a class from a generic base class.
So you'd create
public class GenericClass
{
public virtual void Load();
public virtual void Update();
}
Inside update you would test to see if the class has an id. If it does then this is not a new class otherwise it is.
I usually make my stored procs do update and inserts inside the same proc for less code to keep up with.
if constructor looks like so
public GenericClass( int id ) ** assuming the class uses an int id(indentity field)
{
Load(id);
}
this way all classes pass in an id to create
from your program
Player p = new Player(1); <-- has an id of 1
so when you run this code. It processes the PlayerClass Contructor for custom stuff first. then calls the Generic contructor with the ID. The Generic class then load the data into the class
By the way the PlayerClass construction should look somthing like
public PlayerClass( int id ) : ( id ) {}
the second will call the base class's constructor with the id
Thats the basics of it. If thats the path your going, I can help you with the code inside Save and Load. But you need to understand what this accomplishes from a high level. And of course, if this is what your trying to do.
Nick
--------------------------------------------------------
1 line of code equals many bugs. So don't write any!!
My mad coder blog
|
|
|
|