|
hello either in sql or c# a code hint will be really helpful. I prefer in sql thou.
|
|
|
|
|
uglyeyes wrote: hello either in sql or c# a code hint will be really helpful. I prefer in sql thou.
Try with sample that I have provided to you !
Abhijit Jana | Codeproject MVP
Web Site : abhijitjana.net
Don't forget to click "Good Answer" on the post(s) that helped you.
|
|
|
|
|
this one worked.
DECLARE @mystring VARCHAR(200)
DECLARE @count INT
DECLARE @max INT
DECLARE @space INT
SET @mystring = 'A quick sly fox jumped over the lazy brown dog'
SET @count = 0
SET @max = 7
SET @space = 1
SET NOCOUNT ON
WHILE @count < @max
BEGIN
SELECT @space = CHARINDEX (' ', @mystring , @space + 1)
-- SELECT 'position: ', @space
SET @count = @count + 1
END
SELECT LEFT(@mystring,@space)
SET NOCOUNT OFF
|
|
|
|
|
Abhijit Jana | Codeproject MVP
Web Site : abhijitjana.net
Don't forget to click "Good Answer" on the post(s) that helped you.
|
|
|
|
|
Ok, I think via database it works but I need to use this logic via c# code. could someone please show me how to write a function that will give me same output. thanks in advance
below code runs two times and prints it twice. how can i make it more efficient so it loads faster and dispalys only once?
public string getAdBrief(string text)
{
string s = "";
string[] words = text.Split(' ');
for (int i = 0; i < 7; i++)
{
s +=words[i] + ' ';
}
return s;
}
modified on Wednesday, November 18, 2009 9:30 PM
|
|
|
|
|
never mind this helped
public static string GetFirstFewWords(string input, int numberWords)
{
if (input.Split(new char[] { ' ' },
StringSplitOptions.RemoveEmptyEntries).Length > numberWords)
{
int words = numberWords;
for (int i = 0; i < input.Length; i++)
{
if (input[i] == ' ')
{
words--;
}
if (words == 0)
{
return input.Substring(0, i);
}
}
return string.Empty;
}
else
{
return input;
}
}
|
|
|
|
|
Do we have a little nice. Net framework, such as: Castle, NHiBernate
If it is a better ORM
Thanks ![Wink | ;)](https://codeproject.freetls.fastly.net/script/Forums/Images/smiley_wink.gif)
|
|
|
|
|
Why is no one to help me, because I was in China do? Or do not think my English is wrong about this?
|
|
|
|
|
lrsoft2009 wrote: Why is no one to help me, because I was in China do? Or do not think my English is wrong about this?
It is not like that my friend. If some body know the answer you will definitely get the answer. Or may be you can give some more description of your question so that people can understand well.
Abhijit Jana | Codeproject MVP
Web Site : abhijitjana.net
Don't forget to click "Good Answer" on the post(s) that helped you.
|
|
|
|
|
You are in the wrong forum dude..!Try .net framework..!
BTW What do u want to do..!
LatestArticle :Log4Net
Why Do Some People Forget To Mark as Answer .If It Helps.
|
|
|
|
|
i have used <asp:login> control and <asp:changepassword> control its works fine on my local machine but on live server if user already logedin and click on change password page redirect to login page...
Please Reply if you have any solution
Thanks
|
|
|
|
|
To where you are redirecting the page from change password i think it redirecting to other page in which you restrict may be to admin page..!
Check tht..!
LatestArticle :Log4Net
Why Do Some People Forget To Mark as Answer .If It Helps.
|
|
|
|
|
|
I've the following on my web.config file:
<authentication mode= "Forms">
<forms name=".ASPXFORMSDEMO" loginUrl="login.aspx"
protection="All" path="/" timeout="30" />
</authentication>
</system.web>
<!-- Require authorization for all files -->
<!-- in the "member" subdirectory -->
<system.web>
<authorization>
<allow users="*" />
<deny users="?" />
</authorization>
</system.web>
<location path="images">
<system.web>
<authorization>
<allow users="?" />
</authorization>
</system.web>
</location>
This last section (path="images") its because not authorized users need to access image files so they can load login.aspx.
However, with this configuration, unauthorized users can access others .aspx, they are not redirect to login.aspx. They are allowed to access anywhere.
Why is it happening?
|
|
|
|
|
Maxdd 7 wrote: <allow users="?">
As far as my understanding
means every one can access...!If u want to restrict access to every one and access to only login users it should be
< deny users="?" / >
if you want to give access to all remove tht section simple as tht..!
LatestArticle :Log4Net
Why Do Some People Forget To Mark as Answer .If It Helps.
|
|
|
|
|
I need to give access to all to login.aspx, and restrict access to the rest, only to authorized users, that's why I allow unauthorized users to subdirectory images (so they can load images of login.aspx) and then try restrict access to the other pages :
allow users="*" />
<deny users="?" />
But obviously I'm doing wrong..
|
|
|
|
|
Maxdd 7 wrote: deny users="?"
Why to give this again.Its no need..!
Oh Your Folder Structure,i am not getting it ..!
Maxdd 7 wrote: I need to give access to all to login.aspx, and restrict access to the rest, only to authorized users
This is bit confusing
You need to be more clear .
AS far as my understanding..!
1)You have login page which need to access for all..!
2)The images in the login page is to be restricted to all user
Is Tht what you Want to do?
Then Thts bit typical way you are using..!
try like this.Move the login.aspx to root..!
but restrict only the folder images is a bad idea..!
LatestArticle :Log4Net
Why Do Some People Forget To Mark as Answer .If It Helps.
|
|
|
|
|
<allow users="*" />
<deny users="?" />
The first rule applies, in this case allow users = "*"
If you want to only allow access to authenticated users, use something like deny users = "?"
But never use allow users = "*" as the first rule, because oncea rule applies the ones below are ignored
Alexei Rodriguez
|
|
|
|
|
AlexeiXX3 wrote:
But never use allow users = "*" as the first rule, because oncea rule applies the ones below are ignored
Yes that was the problem.
So what I did is just put all files (except login.aspx) on a folder members, and then all I just need is that:
<location path="members">
<system.web>
<authorization>
<deny users="?" />
</authorization>
</system.web>
</location>
|
|
|
|
|
Hello,
I have created a web site in visual studio 2008 and sql server 2005. it contains a crystal report.
It works fine when hosted in IIS. but in apache server.. Report page in not coming for a long time.
finally its not coming. Please help me asap.
( # Is somthing else i have to write in apache config httpd ?)
|
|
|
|
|
You cannot host an ASP.NET site on Apache. I told someone that in this forum only a few hours ago.
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.
|
|
|
|
|
Christian Graus wrote: You cannot host an ASP.NET site on Apache
With due respect brother, i have seen people to run asp.net page on apache server by using this third pirty tool : (i have done my self)
http://weblogs.asp.net/israelio/archive/2005/09/11/424852.aspx
Its running ok . but the page containg a 'reportViewer with a source of crystal report file (*.rpt)' is not loading.
# Crystal engine is intalled.
Please Help me.
|
|
|
|
|
Ok, so you need some hideous hack to make ASP.NET work, perhaps you need another to make Crystal Reports work ?
I'd hate to be trapped in ASP.NET 2.0, just so I could use apache.
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 dear!!!!! i think u got it wrongly.
i didn't hack asp.net.
i made a way to run asp in apache & apache allow this.
just google it & u will get the ans.
but i can't get ant solution for crystal problem.
if u have any solution then please share here else i have no intention & wish to make a huge debate on ur previous ans.
thanks.
|
|
|
|
|
amran imu wrote: no dear!!!!! i think u got it wrongly.
i didn't hack asp.net.
you found something you can install to make it work, is all I am saying. I am suggesting that as it's a third party, free and unsupported solution, it's not surprising it doesn't support Crystal reports.
I am saying if you used the proper tools, it would work. The route you're taking, I'm not surprised there's issues. I hope you solve them, but if you wanted reliability you wouldn't be walking the path you are.
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.
|
|
|
|