|
Hi,
I right clicked on my project and added a dataset called
'PlntAccuracySWDst.xsd' and dragged the 'PlantInventoryAccuracy' table
that I want to work with from the server Exploerer on to it.
I am trying to access this dataset in my code behind
PlntAccuracySWDst mySWdst = new PlntAccuracySWDst();
For some reason I can't see 'PlantInventoryAccuracyTableAdapter' and
'PlantInventoryAccuracy' datatable objects when I do the 'mySWdst.
(dot)' in my codebehind file. Am I missing some thing here? I have
Select, Insert, and Update stored procs defined in the database and I
want to be able use those here. But as a first step I am unable to
access the DataTable and Table adapters.
Looks like I need to generate the Schema as a typed dataset. But when
I right click on the dataset I do not see the 'Generate Dataset'
option for me to select. so there is no PlntAccuracySWDst.cs file was
created under my 'PlntAccuracySWDst.xsd' file in my solution explorer.
I guess that is the reason why (becuase there is no Schema
generated) I can't access it from my code behind file.
Later on I found out that the the 'Generate Dataset' option is under
the View/Tollbars/DataDesign in my VS 2005. I just selected it and
this action placed a small tool bar under the Standard Tool bar. The
'Generate Dataset' is one of the icons on it. But unfortunately it is
disabled. I am not sure what I am missing here. I need to be able to
create the Schema by clicking the 'Generate Dataset' option.
I am still looking for help. I have searched online all talk about the steps creating typed datasets but none of the articles address what to do to 'Generate Dataset'. Any help is appreciated.
Thanks,
L
|
|
|
|
|
Hi,
I want to know how can I have single active session for single user?
For ex.
Consider I login to website and after successful login my ID is stored in session and If I leave this session in active mode and login to the website using another PC I am able to login to the site and both of my session are active. How can I abandon previous session?
Is there anyway I can achieve this?
Thanking You!
Rock Star
|
|
|
|
|
the server allow only single session!!!
|
|
|
|
|
Nope
I am just using one session in application to store user id thats it.
Rock Star
|
|
|
|
|
Hi
Why did not you deny that log-on when someone have logged on via that account already?
Mohammad Khansari
|
|
|
|
|
I dont want to hit my database for it. without hitting my database I want to achieve this functionality.
Rock Star
|
|
|
|
|
You can create a static class that contains
SessionIDs and UserIDs(or IPAddresses) that logged on
and use that for checking log-on.
like
static class SessionList
{
static ArrayList Sessions;
...
}
OR
You can use Applications State for that
Mohammad Khansari
|
|
|
|
|
Just put the ip to storage while the user logs in. Also for every request, check if the client ip is there in the server.
If the user logs in from another computer, just replace the ip with the new one.
Thus any request from the other client will be rejected as it first checks to the database value which is changed.
|
|
|
|
|
That's a great idea
But is there anything else so I dont have to hit the database.
Rock Star
|
|
|
|
|
You might use Cache or Application. Both are Global and In memory shared variable. In case of application you use :
Application.Lock();
Application[currentUserName] = IP;
Application.UnLock();
If you are using Cache, you dont need to lock as it handles automatically.
|
|
|
|
|
You may want to try looking at the cache class. It's like a session, but it's application level(from what I've been reading about it)
MSDN Link[]
|
|
|
|
|
The solution I will give you will only work if you are NOT in a web-farm and if you have a Session manager that supports informing you when a session dies.
Create a dictionary, like:
private static Dictionary<string, string> _someDictionaty = new Dictionary<string, string>();
Each time a user log-ins (after you validated the password) will do:
lock(_someDictionary)
_someDictionary[...loginHere...] = HttpContext.Current.Session.SessionID;
Except from the login page, you must check if the "actual" session is the active session for logged user. So:
string activeSessionId;
lock(_someDictionary)
{
if (_someDictionary.TryGetValue(...loginHere..., out activeSessionId)
{
if (activeSessionId != HttpContext.Current.Session.SessionID)
}
else
{
}
}
And finally, in Global.asax, in the Session_End method, you must remove the session for that user, so:
var pair = new KeyValuePair<string, string>(...loginHere..., HttpContext.Current.Session.SessionID);
IDictionary<string, string> dictionary = _someDictionary;
lock(_someDictionary)
dictionary.Remove(pair);
I used the Remove that accepts a key/value pair because if a session ends that is not the valid one we must simple ignore it.
|
|
|
|
|
|
Hi,
I m getting the following errors.
Error 1 The type or namespace name 'KeyValuePair' could not be found (are you missing a using directive or an assembly reference?)
Error 2 The non-generic type 'System.Collections.IDictionary' cannot be used with type arguments
Error 3 The name '_someDictionary' does not exist in the current context D:\Projects\Demo\Website\Global.asax
Error 4 The name '_someDictionary' does not exist in the current context D:\Projects\Demo\Website\Global.asax
And it is not allowing me to declare dictionary as private static
Rock Star
|
|
|
|
|
If I am not wrong, the KeyValuePair and the Dictionary classes are in the System.Collections.Generic
But, to be honest, I always use the editor to add them to me. When you put the caret in the class name, a small rectangle appears. Click in it, and one of the options is to add the using reference.
|
|
|
|
|
Yes I am using system.collection.generic. But dont know why I am still getting the same error.
Thanking You!
Rock Star
|
|
|
|
|
Is there any one who know how to use textbox as suggest word which will fached from database
i used ajax tool autocompliteextender but it doesnt fire function of webservice.asmx.is ther any step by step processer for this.
if require i will Show my current code which is not working.
plz help me
|
|
|
|
|
|
HI
I have cached user control, which has two link buttons on it and it is present in the whole application, i have cached it, but now link buttons events are not firing, any body know whts the issue, kindly reply ASAP, thanks in adavance.
regards,
|
|
|
|
|
How you did cache on the buttons?
Did you put output cache on the page?
Let share your code, otherwise no one will understand what problem you found...
|
|
|
|
|
I cached the whole user control which contained the two link buttons as well with the cache out put directive @outputcache on the top of user control,
|
|
|
|
|
Can Any One Tell Me Where Can I Find A Good ASP.NET With C# For Beggener!!!
|
|
|
|
|
sanforjackass wrote: Can Any One Tell Me Where Can I Find A Good ASP.NET With C# For Beggener!!!
So you are looking for some beginners tutorials.
Have a look
Asp.net beginners tutorials[^]
Abhijit Jana | Codeproject MVP
Web Site : abhijitjana.net
Don't forget to click "Good Answer" on the post(s) that helped you.
|
|
|
|
|
I Google It A Lot But!!!!!!!!!
All Of It With VB!!!!!!1
|
|
|
|
|