|
if(select count(*) from tablename where username='username') >0)<br />
begin<br />
print 'Username exists'<br />
else<br />
print 'username does not exists'<br />
end
I Love T-SQL
"Don't torture yourself,let the life to do it for you."
If my post helps you kindly save my time by voting my post.
www.aktualiteti.com
|
|
|
|
|
rummer wrote: Hi i want to check that this name exist in database or not.
Create Simple SP, Pass the User Name as a parameter and check it is available in database or not. If yes, then alert user that User already exist, else go ahead.
Abhijit Jana | Codeproject MVP
Web Site : abhijitjana.net
Don't forget to click "Good Answer" on the post(s) that helped you.
|
|
|
|
|
ya also we want to check that name is allready exist or not
|
|
|
|
|
rummer wrote: ya also we want to check that name is allready exist or not
Please dont cross Post.
No one can understand your question, if they didn't read the last post. So, Either reply of my question or Modify your Last Post
Abhijit Jana | Codeproject MVP
Web Site : abhijitjana.net
Don't forget to click "Good Answer" on the post(s) that helped you.
|
|
|
|
|
rummer wrote: ya also we want to check that name is allready exist or not
Would you care to elobrate that?
What is the scenario? What have you done so far?
Manas Bhardwaj
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
He has asked the same question Three times, but He is not still clear what he want or may be he is not able to express.
Abhijit Jana | Codeproject MVP
Web Site : abhijitjana.net
Don't forget to click "Good Answer" on the post(s) that helped you.
|
|
|
|
|
That is why I loved this line which I read somewhere.
'Everyone can program, but not everyone can be a programmer'
Manas Bhardwaj
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
Manas Bhardwaj wrote: I read somewhere.
May be from Here[^]
Abhijit Jana | Codeproject MVP
Web Site : abhijitjana.net
Don't forget to click "Good Answer" on the post(s) that helped you.
|
|
|
|
|
Abhijit Jana wrote: May be from Here[^]
Manas Bhardwaj
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
from where you are looking that name
Cheers!!
Brij
|
|
|
|
|
Brij, He don't know. . If you want to understnd what he actually wants, you need to read all of three post.
Abhijit Jana | Codeproject MVP
Web Site : abhijitjana.net
Don't forget to click "Good Answer" on the post(s) that helped you.
|
|
|
|
|
He must provide the links of all connected question to get the answer
Cheers!!
Brij
|
|
|
|
|
ya also we want to check that name is allready exist or not
modified on Saturday, September 5, 2009 5:00 AM
|
|
|
|
|
rummer wrote: i m entering username so we want to check user not enter same username,
so we want to check username by javascript code in clientside.
I didn't get your question . You want to check the same user name already exist or not ?
Abhijit Jana | Codeproject MVP
Web Site : abhijitjana.net
Don't forget to click "Good Answer" on the post(s) that helped you.
|
|
|
|
|
Javascript is always at client side and I can not think of any application having two users logged in from one browser.
It would be better if you tell us what you are actaully trying to achieve.
Manas Bhardwaj
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
hii...
i have populated my menu control dynamically.i want the menu items to allign left
but i dont found any such property.also i want to fix the width of menuitems.how can i do it...
reply...thanks..
|
|
|
|
|
Why you not using CSS for fixing such kind of things ?
Abhijit Jana | Codeproject MVP
Web Site : abhijitjana.net
Don't forget to click "Good Answer" on the post(s) that helped you.
|
|
|
|
|
|
In an ASP.NET C# application, I have a class called "MyPanel" derived from Panel. MyPanel contains a Button with a Click event. The click event is handled in the MyPanel class.
When I store any MyPanel objects in the Session variable and retrieve them on a postback, the Click events seem to disappear. When the user clicks a Button inside the MyPanel object, a postback happens, but the click events don't get executed. I have to "relink" the click handlers when I retrieve the MyPanel objects from Session.
I am using InProc Session mode. I had though I could store even complex objects in the Session variable. But I lose the events in the objects.
Is this explainable?
Thanks,
Mark
|
|
|
|
|
Why would you store them in a session ? How do the clicks 'disappear' ? A click event exists only for a postback. Once you store it in the session, it's just an object, it can't fire anything from the session and there's no event to store.
The other issue is that your controls are regenerated on every postback. So, I doubt you'd have a reference to the same control, which means that any clicks that occured, would not occur in the controls you have in your session, as they are not all references to the same control.
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.
|
|
|
|
|
A few questions: Is your mypanel object an actual object on the page, or are you initializing it at run-time? Are you wiring up the events by hand? Where are the events wired (what page event)? Why are you manually storing the object in the session?
If you are re-linking the event handlers with each postback, I imagine that the click event itself is getting lost.
1) click event is generated - postback
2) event is re-linked to a handler (in page load?)
3) original click event should be handled, but the event handler was re-assigned in step 2...event is lost.
I'm guessing that your object is not actually part of the page, but is created at run-time. I'm also guessing that this is why you are losing events. I would try to come up with a solution that involved the mypanel object as a 'static' object on the page. You will also avoid having to put the mypanel object in session state as a result.
Best of luck.
Rob
tagyurit.com
|
|
|
|
|
Thanks for the responses.
To Rob...My MyPanel objects are objects on the page that are being dynamically created at runtime. Therefore at runtime, various user actions cause MyPanel objects to be created. When they are instantiated, the code links up click events for the buttons within.
Since these dynamic MyPanel objects must persist between post-backs, my thought was to store them in an Array-List which is stored in the Session object. It works well, but I find the Click events no longer work after I pull them out of the Session object after the post-back. I must relink the Click events at that time.
I am just wondering why.
Thanks,
Mark
|
|
|
|
|
In a sense, all event handlers are re-linked at postback. The difference is that objects that are static on your page have their handlers automatically linked by the framework. Since your control is dynamic, you must do it yourself.
This link may be of interest to you:http://msdn.microsoft.com/en-us/library/ms178472.aspx[^]
Is it possible to place the panels on the page as static objects and change their visibility property to hide them if you don't need them? Do you have variable set of panels preventing you from doing this? Give me a little more background - maybe there is a simpler solution.
Rob
http://tagyurit.com
|
|
|
|
|
Thanks Rob. I didn't realize that events must be relinked at postback. Since these "MyPanels" are created dynamically, I guess the viewstate doesn't handle that for me and I will have to relink the events myself? That is how I am interpreting what you are saying.
I am still learning about ASP.NET. I will investigate static objects. Maybe that is what I need to use.
Thanks,
Mark
|
|
|
|
|
Hi everyone!
I'm working with a data grid and I would like to tie in some javascript. I have a field with a label that will have a numerical value. Two buttons are also in this cell and I want one to increase that number and the other to decrease it. Is there a way during the grid.databind event that I can add the client side onclick event to the buttons which will in turn be able to find the current row's label control client ID? This way, I can have each button call a single javascript function but pass it the row's label control that I want it to affect. I've done this before with static controls on the page, but I'm not sure how to start this one because (I'm assuming) each label on the gridview will have a different client side ID.
Thanks!
Knowledge is not power, however, the acquisition and appropriate application of knowledge can make you a very powerful individual.
|
|
|
|