|
Iam dynamically retriving the companyname from database to display in the page where i binded while clicking that companyname to pass complete companyname.
Can you pls give me some examples, it will be gr8 full to me, pls
krishna
|
|
|
|
|
I don't use asp, so I could be wrong. But in html, & signs must be escaped.
You need to create a function to process the company name that you read from the database and replace any illegal html characters like < or > or & with the correct escape string.
(I noticed in my last post the escape string was escaped the string you need is "&" without the quotes.)
(There is probably already a function to do this. You might be better asking this question in the asp.net forum)
Simon
|
|
|
|
|
ASP.Net questions belong in the ASP.Net forum!
Harvey Saayman - South Africa
Junior Developer
.Net, C#, SQL
you.suck = (you.Passion != Programming & you.Occupation == jobTitles.Programmer)
1000100 1101111 1100101 1110011 100000 1110100 1101000 1101001 1110011 100000 1101101 1100101 1100001 1101110 100000 1101001 1101101 100000 1100001 100000 1100111 1100101 1100101 1101011 111111
|
|
|
|
|
You have to url-encode the string that you put in an url:
<a href="newdetails1.aspx?pid=<%#Server.UrlEncode(Eval("companyname"))%>">
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
Use HttpUtility.URLEncode()
This will solve your problem.
Thanks & Regards
Pete
SIEMENS Information Systems Ltd
|
|
|
|
|
Hi,
.net 2 vs2005
I have a winform app with a close button. The code behind the close is this.Close(); this.Dispose();
The problem is that after deploying my app, in the task manager I can still see my exe under processes after pressing the close button. Do I need to shut down differently?
Thanks,
Chas
|
|
|
|
|
You don't need to call this.dispose on the apps main form. If you started it up correctly (by using Application.Run(new Form1()); ) then the calling code will do the dispose for you. Do this first, and check that it's not causing your problem.
Apps remaining running is usually because you haven't stopped a background thread somewhere. Are you using any background workers, or threads, or anything like that? Check they are all stopped and disposed of before the form is closed.
Simon
|
|
|
|
|
try to use
Application.Exit(); hope it helps
dhaim
programming is a hobby that make some money as side effect
|
|
|
|
|
Hi all,
this msg is regarding my previous post.
(how to hide OS and run only SINGLE application)
i ve created a WIndows Service and it starts automatically with computer.
But how can I run my application from that Service.
My Windows service resides in the same project.
So where i m stuck is : How can i Run my application form the WIndows service?
I wrote OnStart event of Windows Service and wrote System.Diagnostics.Process in it,
but it did not work?
ANy solution.....
Regards,
SIFAR.
|
|
|
|
|
Are you sure OnStart event fired sucessfully in your windows service..
Venky
|
|
|
|
|
How do you know it didn't work?
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
ServerManager mgr = new ServerManager();
mgr.ApplicationPools["test"].Enable32BitAppOnWin64 = true;
mgr.CommitChanges();
Above code should set property Enable32BitAppOnWin64 to true for application pool having name test, but it doesn't do that, can anyone please tell what am I doing wrong.
Please note that ServerManager class is present in Microsoft.Web.Administration namespace.
Thanks,
Mushq
|
|
|
|
|
Do you get any exceptions? I use the following code and it works fine for me (cutdown a bit):
using (ServerManager mgr = new ServerManager())
{
ApplicationPool appPool = mgr.ApplicationPools[appPoolName];
if (appPool == null)
throw new ApplicationException(string.Format("The pool {0} does not exist", appPoolName));
appPool.Enable32BitAppOnWin64 = true;
mgr.CommitChanges();
}
|
|
|
|
|
Hi Pete,
Thanks for the response and sorry for the late reply.
Pete O'Hanlon wrote: Do you get any exceptions?
No, I don't get any exception.
I have observed when i try to set property through code it shows me that the property has been successfully changed to true even next time I try to get that property programmatically it shows me that property is true, but when I open that in IIS it shows me that property to be false.
Please check the screen shot for that.
http://img87.imageshack.us/my.php?image=iiswin32bitcheckmf6.jpg[^]
Kind Regards,
Mushq
|
|
|
|
|
Hi Pete O'Hanlon,
I was checking that property incorrectly, you are right that your mentioned code is working fine.
Thanks a lot.
Kind Regards,
Mushq
|
|
|
|
|
hello
I am trying to get the return parameter from database stored procedure (very simple basic test):
create procedure TQMSpGetConcattenatedString @string1 varchar(50),@string2 varchar(50),@string3 varchar(50) output
as
set nocount on
select @string3 = @string1 + @string2
works fine when execute in query analyser. Then try to execute from C# code as follows:
private static string test2()
{
IDbCommand cmd = Program.db.GetCommand ();
cmd.Connection = Program.db.Connection;
cmd.CommandText = "TQMSpGetConcattenatedString";
cmd.CommandType = CommandType.StoredProcedure ;
IDataParameter p1 = Program.db.getDataParameter ();
p1.ParameterName = "@string1";
p1.Direction = ParameterDirection.Input ;
p1.DbType = DbType.String ;
p1.Value = "Monkey";
cmd.Parameters.Add (p1);
IDataParameter p2 = Program.db.getDataParameter ();
p2.ParameterName = "@string2";
p2.Direction = ParameterDirection.Input ;
p2.DbType = DbType.String ;
p2.Value = "Tail";
cmd.Parameters.Add (p2);
IDataParameter p3 = Program.db.getDataParameter ();
p3.ParameterName = "@string3";
p3.Direction = ParameterDirection.Output;
p3.DbType = DbType.String ;
p3.Value = "-";
cmd.Parameters.Add (p3);
cmd.ExecuteNonQuery ();
return p3.Value.ToString();
}
the return string only has 1 character in it. When i use SqlParameter it works good.
Does anybody have a suggestion for me?
|
|
|
|
|
jVersteegen wrote: cmd.ExecuteNonQuery ();
Don't use this. You're executing a query, so use something like ExecuteDataReader() instead. Also, you need to close your connection and command. I suggest that you wrap them up in using blocks.
|
|
|
|
|
Thanks for the suggestion!
I'm not executing a query but a stored procedure.
your suggestion does not change the result.
by the way: what 's the advantage of a using block?
|
|
|
|
|
ExecuteNonQuery is used for update/insert type queries (or stored procs) which do not return data.
The advantage of a using block is that it automatically closes/disposes for you.
you do not get the value of the output parameters until your connection is closed. A starnge thing, but there you are, thats how it works.
Bob
Ashfield Consultants Ltd
|
|
|
|
|
Like i say before: when i use SqlDataParameter and not IDataParameter it works fine.
But i want to be able to connect to SqlServer OR Oracle database, so i try IDataParameter.
So it has to with the parameter, not the connection. When i do not set the size for a SqlParameter, the result is also the first character only. However i cannot set the size for IDataParameter.
|
|
|
|
|
You don't need to assign a value to your output parameter. I suspect that it may be setting the size of the parameter because you only assign a single character to the input here.
|
|
|
|
|
tried that: an null value resluts in an error (invalid size property),
a very long string or empty string or gives the same result (only one char).
|
|
|
|
|
What character do you get back? Is it the one you'd expect?
|
|
|
|
|
It is the "M" from "Monkey", but i want "MonketTail".
|
|
|
|
|
found it!
I incidently selected IDataParameter interface, which should have been IDbDataParameter.
IDbDataParameter parameters have a size property.
Thanks for the trouble taken to try to help!
bye.
|
|
|
|