|
Interesting. So what am I doing wrong? Doesn't a generic require a type? How do I specify a datasource that can provide strings?
|
|
|
|
|
Just saw the rest of your response. Thanks! I'll try it.
|
|
|
|
|
I'm hoping someone can help me out here, I am attempting to Serialize an object which contains a List<class> of another class into XML. However no matter what I try it always produces this:
RootElement
OrganisationXML
Organisation
/Organisation
Organisation
/Organisation
/OrganisationXML
/RootElement
Is there anyway to stop it producing the name of the generic List and just output the items contained in the list,
i.e.
RootElement
Organisation
/Organisation
Organisation
/Organisation
/RootElement
Any ideas would be greatly appreciated....
|
|
|
|
|
RichardContact-1 wrote: However no matter what I try it always produces this:
It appears you have not posted the '<' and '>' correctly. Read the posting guidelines to see how to manage those characters.
led mike
|
|
|
|
|
Hello every one,
After read some articles about WCF, I made some performace test, and in my test the WCF is worst than WS
The first test I have made it the time response, I create 3 services, one is WS and 2 WCF, one with basicHttpBiding(WS standard equivalent) and another with wsHttpBindig(WSE equivalent).
All services return one dataset, I try with 2mb data anda 128k data, in both cases the WS is faster than WCF, faster in comparison basicHttpBinding and aldo wsHttpBinding, in all cases I tested in IIS6 as a host.
http://img132.imageshack.us/img132/6813/wsxwcfmt8.png
Tempo gasto = time elapse
milisegundos = milliseconds
<br />
private void btnNormalWeb_Click(object sender, EventArgs e)<br />
{<br />
DataSet dsReturn;<br />
DateTime d1, d2;<br />
wsTeste.wsTeste objwsTeste = new wsTeste.wsTeste();<br />
<br />
d1 = DateTime.Now;<br />
dsReturn = objwsTeste.Retorno();<br />
d2 = DateTime.Now;<br />
lblTempoExecucaoWS.Text = string.Format("Tempo Gasto Normal: {0} milisegundos", (d2 - d1).TotalMilliseconds);<br />
}<br />
<br />
private void btnNormalWCF_Click(object sender, EventArgs e)<br />
{<br />
DataSet dsReturn;<br />
DateTime d1, d2;<br />
wcfServiceBasic.WCFServiceClient objwcfTeste = new wcfServiceBasic.WCFServiceClient();<br />
<br />
d1 = DateTime.Now;<br />
dsReturn = objwcfTeste.Retorno(); <br />
d2 = DateTime.Now;<br />
lblTempoExecucaoWCFBasic.Text = string.Format("Tempo Gasto Basic: {0} milisegundos", (d2 - d1).TotalMilliseconds); <br />
}<br />
<br />
private void btnNormalWCFWSE_Click(object sender, EventArgs e)<br />
{<br />
DataSet dsReturn;<br />
DateTime d1, d2;<br />
wcfServiceWSE.WCFServiceClient objwcfTeste = new wcfServiceWSE.WCFServiceClient();<br />
<br />
d1 = DateTime.Now;<br />
dsReturn = objwcfTeste.Retorno();<br />
d2 = DateTime.Now;<br />
lblTempoExecucaoWCFWSE.Text = string.Format("Tempo Gasto WSE: {0} milisegundos", (d2 - d1).TotalMilliseconds);<br />
}<br /> ;
Some one know why the WCF im my case are not fast enough WS.
Sorry by English!
|
|
|
|
|
hi;
I wanna create new items acording to database .i add them in a panel but cant access data which user select.How can i acces it?i wanna take all data whit 1 button click as well
<br />
<br />
<br />
void opencon()<br />
{<br />
con= new OleDbConnection("Provider=Microsoft.Jet.Oledb.4.0;Data Source=" +<br />
Server.MapPath("db/xxx.mdb"));<br />
<br />
}<br />
<br />
void objeckcreate()<br />
{<br />
...get values and items for exp. shows=1 dropdown its goes to nuber of data <br />
<br />
<br />
<br />
if (shows== 1)<br />
{<br />
....use literal to make see good:D<br />
Literal ltr2 = new Literal();<br />
ltr2.Text = "its work "<br />
Panel1.Controls.Add(ltr2);<br />
<br />
Label basdrop= new Label();<br />
nameofshow.ID = "nameshow" + nameshowdatavalue;<br />
nameofshow.Text=nameobject;<br />
Panel1.Controls.Add(nameofshow);<br />
<br />
DropDownList Mydrop= new DropDownList();<br />
Mydrop.ID = "Mydrop" + namedatavalue;<br />
<br />
<br />
con.Open();<br />
...fill whit dataset dropdowns<br />
<br />
Mydrop.DataSource = xdataset.Tables["xlol"];<br />
Mydrop.DataTextField ="namefield";<br />
Mydrop.DataValueField = "namevalue";<br />
Mydrop.DataBind();<br />
Mydrop.Width=100;<br />
con.Close();<br />
Mydrop.Items.Insert(0, "--Choose--");<br />
Mydrop.AutoPostBack = true;<br />
<br />
<br />
dropportfoyekle.SelectedIndexChanged += new EventHandler(deneme_SelectedIndexChanged);<br />
...i try put 1 static dropdown and use its spec but cant work cause them not public:(<br />
<br />
Panel1.Controls.Add(dropportfoyekle);<br />
<br />
<br />
}<br />
<br />
<br />
}<br />
protected void Page_Load(object sender, EventArgs e)<br />
{<br />
opencon();<br />
if (!this.Page.IsPostBack)<br />
{<br />
<br />
objeckcreate();<br />
}<br />
}<br />
protected void button_Click(object sender, EventArgs e)<br />
{<br />
<br />
how can i takeee<br />
}<br />
<br />
<br />
ty
|
|
|
|
|
Hi, I have two datatables each table contain one column. I want to make a new data table that should contain both columns. Can u plz tell me how can I do this in c#.net. I will be thankful to you,
Regards,
|
|
|
|
|
dt2.Columns.Add ( dt1.Columns [ 0 ].ColumnName , dt1.Columns [ 0 ].DataType ) ;
Will create a column with the same name and type, but you'll have to iterate the rows to copy the data.
|
|
|
|
|
thanks a lot for ur reply, plz tell me is there any way to copy the data without iteration. actually i want to copy the whole column in another datatable.
thanks,
|
|
|
|
|
When I run a method using the BackgroundWorker in a class do I have to pass any arguments to that method using the Argument property of DoWorkEventArgs or can I just access properties and variables defined within the class?
|
|
|
|
|
If they're startup arguments then it's safer to pass them through the DoWorkEventArgs object. If you're accessing properties of the form you'll have to be careful how you access them because of concurrency / threading issues.
|
|
|
|
|
They aren't GUI properties, just some user defined properties to return a value.
Why is it safer to pass startup arguments through the DoWorkEventArgs?
Every example I have seen seems to assume that the entire background process can be achieved in one function without recourse to other properties, methods and variablies of the class.
|
|
|
|
|
RugbyLeague wrote: Why is it safer to pass startup arguments through the DoWorkEventArgs?
Probably because the arguments (especially value types) might change by the time DoWork runs. Like Ed said, if you are going to access members, you'll have to make sure that you are using proper synchronization.
|
|
|
|
|
They won't change, there's nothing to change them, so can I just access them as usual?
|
|
|
|
|
|
Thanks
|
|
|
|
|
Not quite, you're probably going to get a ThreadAccessException if you do that. You'll need to create a delegate which can return the value. You can then pass this delegate to the Control.Invoke method to retrieve the value. Alternatively you can use the feature of anonymous delegates (can't remember what it's called) where you can access the variables surrounding it. E.g. (note I'm writing this code from memory)
internal delaget int GetCurrentCount();
private int count = 100;
private void BackgroundWorker_DoWork(object sender, DoWorkEventArgs e)
{
int threadedCount = -1;
this.Invoke(new GetCurrentCount(delegate() { threadedCount = this.count; }));
}
|
|
|
|
|
hi i want to listen on http port, or i want to make a socket server that will listen on http port and get the data, but when i use socket bind method then this exception is raised
"Only one usage of each socket address (protocol/network address/port) is normally permitted"
can u plz help me how to do that i mean get the data from http port using sockets.
Regards.
Tasleem Arif
|
|
|
|
|
You can only listen to 1 port at a time. That mean, http port is being used, another application listen also in this port. You must shutdown this application so you can start your application.
|
|
|
|
|
hi
is that anyWay that i see preview of setup dialogs in setup project, (i want to change banners of setup dialogs, but i don't what is resolution, and how to see preview of it ?)
thanks
|
|
|
|
|
|
why not just build it and run it? If the rest of the installer takes to long for this to be feasible then how about making a dummy setup project that just runs through your dialog sequence and exists?
|
|
|
|
|
How to display a message while draging and droping an item from the tree view?
plz help
thanks
Aparna.B
|
|
|
|
|
Take a look at the DragDrop event. Handle the event, and put your code inside it.
I'm going to become rich when I create a device that allows me to punch people in the face over the internet.
"If an Indian asked a programming question in the forest, would it still be urgent?" - John Simmons / outlaw programmer
|
|
|
|
|
it is not working in drag and drop event
|
|
|
|