Thursday, March 29, 2012
Please explain ApplicationID of aspnetdb
Web site? For example, what and when generates application ID?
Any pointers to on-line docs would also be appreciated.
Thanks,
Dan<membership defaultProvider="AccessMembershipProvider">
<providers>
<add name="AccessMembershipProvider"
type="Samples.AccessProviders.AccessMembershipProvider,
AccessProvider"
connectionStringName="AccessFileName"
enablePasswordRetrieval="false"
enablePasswordReset="false" requiresUniqueEmail="false"
requiresQuestionAndAnswer="false"
minRequiredPasswordLength="1"
minRequiredNonalphanumericCharacters="0"
applicationName="SampleSite" hashAlgorithmType="SHA1"
passwordFormat="Hashed"/>
</providers>
</membership>
I believe the ApplicationId is just a primary key for a distinct
"applicationName" in the config file.
"SampleSite" from the above entry.
"Dan" <dan@.nospam.co> wrote in message
news:uDVXrRFiIHA.1168@.TK2MSFTNGP02.phx.gbl...
> Could someone please explain the relationship between ApplicationID and a
> Web site? For example, what and when generates application ID?
> Any pointers to on-line docs would also be appreciated.
> Thanks,
> Dan
>
ApplicationID is a unique id for a website (iis site path). the storedproc
adds a row if it doesn't exist during the lookup.
-- bruce (sqlwork.com)
"Dan" wrote:
> Could someone please explain the relationship between ApplicationID and a
> Web site? For example, what and when generates application ID?
> Any pointers to on-line docs would also be appreciated.
> Thanks,
> Dan
>
>
Please give me an example of IEnumerable and IEnumerator use
Could you please give me an example of IEnumerable implementation on some simple class? (plus the definition of IEnumerator).
I can implement the IEnumerable and return some enumerator but I can't imagine how some enumerator can walk through collection in another class. How does the enumerator gain access to it?
Ifyou have any idea, please share it with me.
Thanks, HookerThe C# docs give a really good example
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/csref/html/vcwlkforeachtutorial.asp
VB version here:
http://support.microsoft.com/?kbid=322025
Wednesday, March 21, 2012
please help me
please help me
for example i have 3 webform names (webform1.aspx.webform2.aspx,webform3.aspx) in webform1.aspx,webform2.aspx this is a hyperlink that url is webform3.aspx when i click this go to webform3
now i know when i in webform3 i login in webform1 or webform2
this is write which webform loginHello,
I didnt get you but maybe you want to get the page redirected from, use this
request.UrlReferrer
regards
Please help me create a list of all active sessions?
of
all active sessions (their sessionid, logontime, etc)?
I need a code example, not a prosa description of what to do..
Anyone..?
Best regards,
ChristinaChristina,
what you need to do is create a Singleton which has a internal collection or
an arraylist.
on session start. look up the user info you require and populate the
arraylist.
--
Regards,
Hermit Dave
(http://hdave.blogspot.com)
"Christina N" <no@.mail.please> wrote in message
news:urCG2rymEHA.2372@.TK2MSFTNGP10.phx.gbl...
> Can anyone give me a code example of how to use a global array to keep
> track
> of
> all active sessions (their sessionid, logontime, etc)?
> I need a code example, not a prosa description of what to do..
> Anyone..?
>
> Best regards,
> Christina
Yes, but HOW do I do that? I need a code example.
Can you help me?
Christina
"Hermit Dave" <hermitd.REMOVE@.CAPS.AND.DOTS.hotmail.com> wrote in message
news:ORAPxgzmEHA.3564@.tk2msftngp13.phx.gbl...
> Christina,
> what you need to do is create a Singleton which has a internal collection
or
> an arraylist.
> on session start. look up the user info you require and populate the
> arraylist.
> --
> Regards,
> Hermit Dave
> (http://hdave.blogspot.com)
> "Christina N" <no@.mail.please> wrote in message
> news:urCG2rymEHA.2372@.TK2MSFTNGP10.phx.gbl...
> > Can anyone give me a code example of how to use a global array to keep
> > track
> > of
> > all active sessions (their sessionid, logontime, etc)?
> > I need a code example, not a prosa description of what to do..
> > Anyone..?
> > Best regards,
> > Christina
writing a small example.. will post it shortly
--
Regards,
Hermit Dave
(http://hdave.blogspot.com)
"Christina N" <no@.mail.com> wrote in message
news:OTD6go1mEHA.3712@.TK2MSFTNGP15.phx.gbl...
> Yes, but HOW do I do that? I need a code example.
> Can you help me?
>
> Christina
>
> "Hermit Dave" <hermitd.REMOVE@.CAPS.AND.DOTS.hotmail.com> wrote in message
> news:ORAPxgzmEHA.3564@.tk2msftngp13.phx.gbl...
> > Christina,
> > what you need to do is create a Singleton which has a internal
collection
> or
> > an arraylist.
> > on session start. look up the user info you require and populate the
> > arraylist.
> > --
> > Regards,
> > Hermit Dave
> > (http://hdave.blogspot.com)
> > "Christina N" <no@.mail.please> wrote in message
> > news:urCG2rymEHA.2372@.TK2MSFTNGP10.phx.gbl...
> > > Can anyone give me a code example of how to use a global array to keep
> > > track
> > > of
> > > all active sessions (their sessionid, logontime, etc)?
> > > > I need a code example, not a prosa description of what to do..
> > > Anyone..?
> > > > > Best regards,
> > > Christina
> >
i will start with a singleton snippet right now.. if you need any further
help you know what to do
using System;
using System.Collections;
public class CUserInfo
{
private string sessionID;
private DataTime sessionTimeStamp;
public CUserInfo(string Sessionid, DateTime SessionTS)
{
sessionID = SessionID;
sessionTimeStamp = SessionTS;
}
public string SessionID
{
get
{
return sessionID;
}
set
{
sessionID = value;
}
}
public DateTime SessionTimeStamp
{
get
{
return sessionTimeStamp;
}
set
{
sessionTimeStamp = value;
}
}
}
public class CSessionManager
{
private static CSessionManager _csmInstance = null;
private ArrayList _alContainer;
private CSessionManager()
{
_alContainer = new ArrayList();
}
public Static CSessionManager GetInstance()
{
if(_csmInstance == null)
{
_csmInstance = new CSessionMananger();
}
return _csmInstance;
}
public Static void AddUserInfo(CUserInfo cui)
{
// do your checks here. like is the info already present ?
_alContainer.Add(cui)
}
public static CUserInfo CurrentUserInfo
{
get
{
string sessionID = this.context.Session.SessionID;
foreach(CUserInfo csi in _alContainer)
{
if(csi.SessionTimeStamp == sessionID)
{
return csi;
break;
}
}
}
set
{
// find the item & update it or remove the item if found
_alContainer.Add(value);
}
}
// Add your public static methods that you wish to call
// say for example to query the SessionManager for count etc
}
Once you create this object you should have the access to same instance
every time you call
CSessionManager myCurrentInstance = CSessionManager.GetInstance();
note that with singleton to get an instance you call the static GetIstance
method and you do not use the new keyword.
Place it in your cache or application object and you should have access
everywhere.
now to add the user
use Global.asax and use the methof Session_Start
here you have access to context object to use it to get session ID
protected void Session_Start(Object sender, EventArgs e)
{
CUserInfo csi = new CUserInfo(this.context.Session.SessionID,
DateTime.Now());
CSessionManager csmanager = CSessionManager.GetInstance();
csmanager.AddUserInfo(csi);
// you should be able to get sessionID (though i never needed to use
session id in this way so am not 100%)
}
--
Regards,
Hermit Dave
(http://hdave.blogspot.com)
"Christina N" <no@.mail.com> wrote in message
news:OTD6go1mEHA.3712@.TK2MSFTNGP15.phx.gbl...
> Yes, but HOW do I do that? I need a code example.
> Can you help me?
>
> Christina
>
> "Hermit Dave" <hermitd.REMOVE@.CAPS.AND.DOTS.hotmail.com> wrote in message
> news:ORAPxgzmEHA.3564@.tk2msftngp13.phx.gbl...
> > Christina,
> > what you need to do is create a Singleton which has a internal
collection
> or
> > an arraylist.
> > on session start. look up the user info you require and populate the
> > arraylist.
> > --
> > Regards,
> > Hermit Dave
> > (http://hdave.blogspot.com)
> > "Christina N" <no@.mail.please> wrote in message
> > news:urCG2rymEHA.2372@.TK2MSFTNGP10.phx.gbl...
> > > Can anyone give me a code example of how to use a global array to keep
> > > track
> > > of
> > > all active sessions (their sessionid, logontime, etc)?
> > > > I need a code example, not a prosa description of what to do..
> > > Anyone..?
> > > > > Best regards,
> > > Christina
> >
Please help me create a list of all active sessions?
of
all active sessions (their sessionid, logontime, etc)?
I need a code example, not a prosa description of what to do..
Anyone..?
Best regards,
ChristinaChristina,
what you need to do is create a Singleton which has a internal collection or
an arraylist.
on session start. look up the user info you require and populate the
arraylist.
Regards,
Hermit Dave
(http://hdave.blogspot.com)
"Christina N" <no@.mail.please> wrote in message
news:urCG2rymEHA.2372@.TK2MSFTNGP10.phx.gbl...
> Can anyone give me a code example of how to use a global array to keep
> track
> of
> all active sessions (their sessionid, logontime, etc)?
> I need a code example, not a prosa description of what to do..
> Anyone..?
>
> Best regards,
> Christina
>
Yes, but HOW do I do that? I need a code example.
Can you help me?
Christina
"Hermit Dave" <hermitd.REMOVE@.CAPS.AND.DOTS.hotmail.com> wrote in message
news:ORAPxgzmEHA.3564@.tk2msftngp13.phx.gbl...
> Christina,
> what you need to do is create a Singleton which has a internal collection
or
> an arraylist.
> on session start. look up the user info you require and populate the
> arraylist.
> --
> Regards,
> Hermit Dave
> (http://hdave.blogspot.com)
> "Christina N" <no@.mail.please> wrote in message
> news:urCG2rymEHA.2372@.TK2MSFTNGP10.phx.gbl...
>
writing a small example.. will post it shortly
Regards,
Hermit Dave
(http://hdave.blogspot.com)
"Christina N" <no@.mail.com> wrote in message
news:OTD6go1mEHA.3712@.TK2MSFTNGP15.phx.gbl...
> Yes, but HOW do I do that? I need a code example.
> Can you help me?
>
> Christina
>
> "Hermit Dave" <hermitd.REMOVE@.CAPS.AND.DOTS.hotmail.com> wrote in message
> news:ORAPxgzmEHA.3564@.tk2msftngp13.phx.gbl...
collection
> or
>
i will start with a singleton snippet right now.. if you need any further
help you know what to do
using System;
using System.Collections;
public class CUserInfo
{
private string sessionID;
private DataTime sessionTimeStamp;
public CUserInfo(string Sessionid, DateTime SessionTS)
{
sessionID = SessionID;
sessionTimeStamp = SessionTS;
}
public string SessionID
{
get
{
return sessionID;
}
set
{
sessionID = value;
}
}
public DateTime SessionTimeStamp
{
get
{
return sessionTimeStamp;
}
set
{
sessionTimeStamp = value;
}
}
}
public class CSessionManager
{
private static CSessionManager _csmInstance = null;
private ArrayList _alContainer;
private CSessionManager()
{
_alContainer = new ArrayList();
}
public Static CSessionManager GetInstance()
{
if(_csmInstance == null)
{
_csmInstance = new CSessionMananger();
}
return _csmInstance;
}
public Static void AddUserInfo(CUserInfo cui)
{
// do your checks here. like is the info already present ?
_alContainer.Add(cui)
}
public static CUserInfo CurrentUserInfo
{
get
{
string sessionID = this.context.Session.SessionID;
foreach(CUserInfo csi in _alContainer)
{
if(csi.SessionTimeStamp == sessionID)
{
return csi;
break;
}
}
}
set
{
// find the item & update it or remove the item if found
_alContainer.Add(value);
}
}
// Add your public static methods that you wish to call
// say for example to query the SessionManager for count etc
}
Once you create this object you should have the access to same instance
every time you call
CSessionManager myCurrentInstance = CSessionManager.GetInstance();
note that with singleton to get an instance you call the static GetIstance
method and you do not use the new keyword.
Place it in your cache or application object and you should have access
everywhere.
now to add the user
use Global.asax and use the methof Session_Start
here you have access to context object to use it to get session ID
protected void Session_Start(Object sender, EventArgs e)
{
CUserInfo csi = new CUserInfo(this.context.Session.SessionID,
DateTime.Now());
CSessionManager csmanager = CSessionManager.GetInstance();
csmanager.AddUserInfo(csi);
// you should be able to get sessionID (though i never needed to use
session id in this way so am not 100%)
}
Regards,
Hermit Dave
(http://hdave.blogspot.com)
"Christina N" <no@.mail.com> wrote in message
news:OTD6go1mEHA.3712@.TK2MSFTNGP15.phx.gbl...
> Yes, but HOW do I do that? I need a code example.
> Can you help me?
>
> Christina
>
> "Hermit Dave" <hermitd.REMOVE@.CAPS.AND.DOTS.hotmail.com> wrote in message
> news:ORAPxgzmEHA.3564@.tk2msftngp13.phx.gbl...
collection
> or
>
please help me for this problem, as I havent done it before.
Hi, all
I want help for the below mentioned problems. PLease give example with source code. Please help me.
1. I have made upto this point. Now i want the functionality that when i enter the item orderd and discount the amount column should be updated as per the
following formula.
amount = rate*item orderd - discount
2. As the amount column updated the sub total should be changed.
3. as the user enter the taxes the grand total should also be changed.
Regards
sp_412000@dotnet.itags.org.yahoo.com
<%@dotnet.itags.org. Import Namespace="System.Data" %>
<%@dotnet.itags.org. Import Namespace="System.Data.OleDb" %>
<script runat="server" language="C#">
void Page_Load(Object src,EventArgs e)
{
OleDbConnection dbConn =
new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=/studynet/Authors2k.mdb;User Id=admin;Password=;" );
OleDbDataAdapter dbAdap = new OleDbDataAdapter("SELECT item_id,item_name,unit,rate,stock FROM product",dbConn);
DataSet ds = new DataSet();
dbAdap.Fill(ds,"product");
rept.DataSource = ds.Tables["product"].DefaultView;
rept.DataBind();
}
</script>
<html>
<form id="form1" runat="server">
<asp:repeater id="rept" runat="server">
<HeaderTemplate>
<table>
<tr>
<th>Del</th>
<th>Item #</th>
<th>Name</th>
<th>Unit</th>
<th>Rate</th>
<th>Item Ordered</th>
<th>Discount</th>
<th>Amount</th>
</tr>
</HeaderTemplate>
<ItemTemplate>
<tr>
<td>
<asp:CheckBox id="chk1" runat="server" />
</td>
<td>
<%# DataBinder.Eval(Container.DataItem,"item_id") %>
</td>
<td>
<%# DataBinder.Eval(Container.DataItem,"item_name") %>
</td>
<td>
<#% DataBinder.Eval(Container.DataItem,"unit") %>
</td>
<td>
<#% DataBinder.Eval(Container.DataItem,"rate") %>
</td>
<td>
<asp:textbox id="txt1" runat="server" />
</td>
<td>
<asp:textbox id="txt2" runat="server" />
</td>
<td>
<asp:textbox id="txt3" runat="server" />
</td>
</tr>
</ItemTemplate>
<FooterTemplate>
</table>
</FooterTemplate>
</asp:repeater>
sub total: <asp:textbox id="subtot" runat="server" />
Taxes: <asp:textbox id="taxes" runat="server" />
Grand Total: <asp:textbox id="gtot" runat="server" />
</form>
</html>
If you want it to be "automatic" then you would add a onchange eventfor the textboxes and have them do the approproate math when the textchanges
HTH
Please help me how to do this - Urgent
I need to merge some of the rows in the datagrid in asp.net 1.1 with
comma separator.For example i have column name Filed_by which list the
customer's full name.Now i need to merge all the customer name cells
into single cell seperated by comma. Please let me know how can i do
that.Also if you have some example that would be great.
Thanks,
VishnuAssuming you cant merge your values in SQL, you can probably iterate the
dataset / datatable in a loop, pick out the values and glue them together or
you could probably just use a templatecolumn and merge the columns that way
As an iteration example this might get you started:
ArrayList s = new ArrayList();
foreach (DataRow myDataRow in myDataSet.Tables["Customers"].Rows)
{
s.Add(myDataRow["filed_by"].ToString() +
myDataRow["full_name"].ToString());
}
Then bind that to your datagrid as shown here
/url]
Regards
John Timney (MVP)
VISIT MY WEBSITE:
[url]http://www.johntimney.com" target="_blank">http://www.johntimney.com/blog/defa...johntimney.com
http://www.johntimney.com/blog
<settyv@.gmail.com> wrote in message
news:1163098102.821494.319230@.k70g2000cwa.googlegroups.com...
> Hi,
> I need to merge some of the rows in the datagrid in asp.net 1.1 with
> comma separator.For example i have column name Filed_by which list the
> customer's full name.Now i need to merge all the customer name cells
> into single cell seperated by comma. Please let me know how can i do
> that.Also if you have some example that would be great.
>
> Thanks,
> Vishnu
>
Please help me how to do this - Urgent
I need to merge some of the rows in the datagrid in asp.net 1.1 with
comma separator.For example i have column name Filed_by which list the
customer's full name.Now i need to merge all the customer name cells
into single cell seperated by comma. Please let me know how can i do
that.Also if you have some example that would be great.
Thanks,
VishnuAssuming you cant merge your values in SQL, you can probably iterate the
dataset / datatable in a loop, pick out the values and glue them together or
you could probably just use a templatecolumn and merge the columns that way
As an iteration example this might get you started:
ArrayList s = new ArrayList();
foreach (DataRow myDataRow in myDataSet.Tables["Customers"].Rows)
{
s.Add(myDataRow["filed_by"].ToString() +
myDataRow["full_name"].ToString());
}
Then bind that to your datagrid as shown here
http://www.johntimney.com/blog/defa...e3-95c3f29a8a8a
--
Regards
John Timney (MVP)
VISIT MY WEBSITE:
http://www.johntimney.com
http://www.johntimney.com/blog
<settyv@.gmail.comwrote in message
news:1163098102.821494.319230@.k70g2000cwa.googlegr oups.com...
Quote:
Originally Posted by
Hi,
>
I need to merge some of the rows in the datagrid in asp.net 1.1 with
comma separator.For example i have column name Filed_by which list the
customer's full name.Now i need to merge all the customer name cells
into single cell seperated by comma. Please let me know how can i do
that.Also if you have some example that would be great.
>
>
Thanks,
Vishnu
>
Friday, March 16, 2012
Please help me to find...
and welcome to the forums.
This is a very interesting link for you that you can use when discovering the datalist control:ASP.NET Data Controls Part 3: DataList.
Grz, Kris.
please help this one is simple
I know how to do it if i compile it, make it a dll file and make it a reference, bu I do not want to do this because i want to beable to edit the code at anytime for some reason i cannot figure out how to accompish this. Seems like it should be very simple?Make a public class named "functions" and all of the methods you want to call "Shared", then include the functions.vb file in the project you want to call them from.
This will allow you call any shared method using the class name . method name from any place in the project.
right now i have functions in a . dll file and i am able to at the top of my code write:
Imports CoreFile.functions
and be able to call methods of the functions class without typing:
CoreFile.functions.GetCookie()
I can just simpley type GetCookie() it seems to me that the Import statement at the top of the code only works with references. is there a way around this? am i doing somthing wrong?
I want to be able to import my functions.vb class
Thanks.
it IS really simple:
if you want to be able to modify your code behind at any time and not have it as a dll then all you need to do is include this at the top of your aspx page:
<%@. Page Inherits="myCodeBehind" src="http://pics.10026.com/?src=myCodeBehind.vb" %>
with this line at the top of your aspx page, you can access any of the functions in your vb file without having it in dll form. just remember to change myCodeBehind.vb to whateveer your codebind.vb page is called.
If you change GetCookie() or any other function inside your functions.vb class you have to re-compile the class and re-compile your application referencing that class (if you want it to access the newly modified functions).
I keep two copies of visual studio open at all times. One has my web application and the other has my functions. Recompile functions, recompile app and now app can access any new functions and the modified functions.
If you think about "how" it works it makes sense. My app references "functions.vb" which is compiled into a DLL and copied into my apps folder. When I re-compile "functions.vb" the newly compiled DLL is still located in it's own base folder. It's not until I re-compile my app that it brings over the new copy of the DLL.
yes that works for a .aspx page but what if i am calling the method from other classes as described above. I can write "Imports CoreFile.functions " at the top of the class
this allows me to call methods of my functions class without writing CoreFile.functions.GetCookie(). Instead I can just write GetCookie() and it recognizes it as CoreFile.functions.GetCookie() is there a way to import a file that is not in references. I want to be able to do something to the effect of "Imports functions.vb" right now it is set as "Imports CoreFile.functions " where CoreFile is a dll defined in references.