|
You have to keep cases..!
LatestArticle :Log4Net
Why Do Some People Forget To Mark as Answer .If It Helps.
|
|
|
|
|
You have to go for 6 cases..!For one Case..!
SELECT productid,sh_desc,price FROM PRODUCTS e
WHERE productid = CASE WHEN @productid IS NULL
THEN productid
ELSE @productid
END
AND.....
LatestArticle :Log4Net
Why Do Some People Forget To Mark as Answer .If It Helps.
|
|
|
|
|
Hi All,
how gmail or yahoo maintain the session of different server because user can get its mail from any server.
Thanks and regards,
Amit Patel
|
|
|
|
|
What do you mean ? You mean, how to set up a web farm ?
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
hi ,
yes when i login we always retrive data from many server through only one session.
thanks and regards
Amit PAtel
|
|
|
|
|
Amit Patel1985 wrote: yes when i login we always retrive data from many server through only one session.
thanks and regards
They may use OutProc Session mode !
Have a look into this,
Exploring Session in ASP.Net[^]
Abhijit Jana | Codeproject MVP
Web Site : abhijitjana.net
Don't forget to click "Good Answer" on the post(s) that helped you.
|
|
|
|
|
hello
i want to implement full text search technique in asp.net
pls provide me example
|
|
|
|
|
ASP.NET has nothing to do with full text searching, which is a function of SQL Server.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
Hi I need a regular expression for 1.00E+05.. I am using [-+]?[0-9]*\.?[0-9]+([eE][-+]?[0-9]+)?|^$ but it is not working..its accepts any character after the numeric value i.e. its returns true for 100abcd, however this is wrong. Only a single e or E should accept.
Pankaj
|
|
|
|
|
Try: [-+]?([0-9]+)\.([0-9])+[eE][\+-]?[0-9][0-9]?
I strongly recommend you get a copy of Expresso[^] - it makes working with regexes so much easier...
[edit]eh up - one o me brackets vanished...it's back now![/edit]
No trees were harmed in the sending of this message; however, a significant number of electrons were slightly inconvenienced.
This message is made of fully recyclable Zeros and Ones
"Rumour has it that if you play Microsoft CDs backwards you will hear Satanic messages.Worse still, is that if you play them forwards they will install Windows"
|
|
|
|
|
Thanks for your help..but I need to allow blank also, means either there should be blank or valid value, but this expression does not allow blank, that's why I added |^$ at the end of the expression. But still not working properly.
Pankaj
|
|
|
|
|
Hi
I am using ManagementObjectSearcher for retrieving Hardware information. But following code returning hardware information of Server PC. But I need Hardware information of client PC. How can i get Hardware information of Client PC?
string Info=""; ManagementObjectSearcher Q;
Q = new ManagementObjectSearcher("root\\CIMV2", "SELECT * FROM Win32_processor");
foreach (ManagementObject mo in Q.Get())
Info+= "<br />CPU Clock Speed: " + mo["CurrentClockSpeed"].ToString();
Q = new ManagementObjectSearcher("root\\CIMV2", "SELECT * FROM Win32_ComputerSystem");
foreach (ManagementObject mo in Q.Get())
Info+= "<br />Total Physical Memory: " + mo["totalphysicalmemory"].ToString();
Q = new ManagementObjectSearcher("root\\CIMV2", "SELECT * FROM Win32_LogicalDisk");
foreach (ManagementObject mo in Q.Get())
Info+= "<br />Serial Number of Drive(" + mo["Caption"] + "): " + mo["VolumeSerialNumber"];
|
|
|
|
|
asfak.ur.rahman wrote: I am using ManagementObjectSearcher for retrieving Hardware information. But following code returning hardware information of Server PC.
Yes, this would give you the information of Server.
You can't retrieve Client Information by using Normal JavaScript as it does not having sufficient rights to access system.
The alternative solution that you can implement is ActiveX but it will work only on IE.
Abhijit Jana | Codeproject MVP
Web Site : abhijitjana.net
Don't forget to click "Good Answer" on the post(s) that helped you.
|
|
|
|
|
|
You can only access Request Header info to get info from the client. ManagementObjectSearcher will get you hardware info of the Host computer.
I guess, you can get IP of the computer and few other things only.
I think if you can make use of plugins like Silverlight or flash , you can extend this upto a certain extent but also be limited.
|
|
|
|
|
In my form, i have a date control which gets the date from UI in the following form:
dpickFromDate.Value=Convert.ToDateTime(DateTime.Today.AddMonths(-1).ToString("d",CultureInfo.CurrentCulture));
dpickToDate.Value=Convert.ToDateTime(DateTime.Today.ToString("d",CultureInfo.CurrentCulture));
However, the customer is complaining that Calendar control throws error when used with locales that have greater than 12 months to their calendars such as Thai.
Is it possible to fix the same by changing the above format? If so, how should it be changed? Is there is something wrong with the above conversion? please help.
I want to store the date in sql server also. So will it be a problem when storing if the number of months is more than 12?
Thanks
Success is the good fortune that comes from aspiration, desperation, perspiration and inspiration.
|
|
|
|
|
Hi!
I have two public property in ascx. for the first time when the pageloads it works fine. but next time when I try to update the value of label control in ascx via aspx it says object ref not set to instance...
my codes
.ascx
public string CountryName
{
get { return lblCountry.Text; }
set
{
if (!(value == ""))
lblCountry.Text = value;
else
lblCountry.Text = "All Country";
}
}
public string AdType
{
get { return lblAdType.Text; }
set
{
if (!(value == ""))
lblAdType.Text = value;
else
lblAdType.Text = "All Ads";
}
}
.aspx
------
public string AdType
{
get { return _AdType; }
set { _AdType = value; }
}
if (!Page.IsPostBack)
{
if (!(Request.QueryString["q"] == null))
{
Session["AdType"] = Request.QueryString["q"];
}
if (Session["AdType"] != null)
{
AdType = Session["AdType"].ToString();
ddAdType.SelectedIndex = ddAdType.Items.IndexOf(ddAdType.Items.FindByText(AdType));
}
this.Left.AdType = ddAdType.SelectedItem.Text; <-- Left is a ascx here. and null ref exception is thrown at this line.
this.Left.CountryName = CountryName;
}
by default the adtype and countryname is empty so Left.ascx displays "All Country" and "All Ads". now when I click one of the link on Left.ascx that redirects to my .aspx?q=xyz
modified on Monday, November 16, 2009 8:10 PM
|
|
|
|
|
What is null ? Is it set in the aspx ? Given that the Page.IsPostback code means it won't run the first time, I assume it's always null....
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
I have modified my post with extra code and explaination. I am not sure what I am doing wrong.
|
|
|
|
|
What is null ? Is it the selecteditem ? Seems most likely to me.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
no there is a value 'xyz for selecteditem.text.
|
|
|
|
|
OK, then Left must be null. Why do you expect that it's not null, where is it declared ? What's the property setter look like, might something inside there be null ?
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
how else can i access Left.ascx if its null. I am guessing aspx loades before ascx loads? before it wasnt the case and was working properly. so how can i ensure that i dont get this exception. thank you
|
|
|
|
|
No, if you declare it in your aspx, it should exist when your page load runs in the aspx. So, the questions I asked still need answering
1 - is it just declared in the aspx ?
2 - is it null when this is called ?
3 - what does the property setter do, might the null be in there ?
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
1. what is just declared in aspx? if you are refering to
this.Left.AdType = ddAdType.SelectedItem.Text;
yes it is just declared in aspx. please note both in aspx and ascx I have public property called AdType and CountryName.
2. It is not null when it loads first. it sets 'All country', 'All Ads' as coded in ascx properties. it is only null when i try to overwrite the value of those labels in ascx
3. I have posted the code for property in ascx. it simply sets the value of the label thats all.
|
|
|
|