Click here to Skip to main content
16,004,882 members
Home / Discussions / ASP.NET
   

ASP.NET

 
QuestionError when deploy website using webdeployment project in vs2008 Pin
Imran Khan Pathan23-Oct-09 3:44
Imran Khan Pathan23-Oct-09 3:44 
AnswerRe: Error when deploy website using webdeployment project in vs2008 Pin
Vimalsoft(Pty) Ltd23-Oct-09 4:22
professionalVimalsoft(Pty) Ltd23-Oct-09 4:22 
Questionprinting a page Pin
vijaylumar23-Oct-09 3:07
vijaylumar23-Oct-09 3:07 
AnswerRe: printing a page Pin
Vimalsoft(Pty) Ltd23-Oct-09 3:33
professionalVimalsoft(Pty) Ltd23-Oct-09 3:33 
GeneralRe: printing a page Pin
vijaylumar23-Oct-09 4:03
vijaylumar23-Oct-09 4:03 
GeneralRe: printing a page Pin
Vimalsoft(Pty) Ltd23-Oct-09 4:09
professionalVimalsoft(Pty) Ltd23-Oct-09 4:09 
AnswerRe: printing a page Pin
Abhishek Sur23-Oct-09 4:15
professionalAbhishek Sur23-Oct-09 4:15 
QuestionNewbie Help Pin
kruegersck23-Oct-09 3:05
kruegersck23-Oct-09 3:05 
All -

I am trying to create a simple app that will capture emails and when my users try to remove their email from the db they get an error. Here is my ASP code:

<asp:AccessDataSource ID="AccessDataSource1" runat="server"
DataFile="~/App_Data/mail.mdb"
DeleteCommand="DELETE FROM [Email] WHERE (([Email] = ?) OR ([Email] IS NULL AND ? IS NULL))"
InsertCommand="INSERT INTO [Email] ([Email]) VALUES (?)"
OldValuesParameterFormatString="original_{0}"
SelectCommand="SELECT [Email] FROM [Email]">
<DeleteParameters>
<asp:ControlParameter ControlID="txtEmail" Name="original_Email"
PropertyName="Text" Type="String" />
</DeleteParameters>
<InsertParameters>
<asp:Parameter Name="Email" Type="String" />
</InsertParameters>
</asp:AccessDataSource>

Here is the code below:

protected void btnSubscribe_Click(object sender, EventArgs e)
{
AccessDataSource1.InsertParameters["Email"].DefaultValue = txtEmail.Text;
try
{
AccessDataSource1.Insert();
txtEmail.Text = "";
lblError.Text = "Email sucessfully added";
}
catch
{
lblError.Text = "Email already exists";
}
}

protected void btnUnSub_Click(object sender, EventArgs e)
{
AccessDataSource1.DeleteParameters["Email"].DefaultValue = txtEmail.Text;
try
{
AccessDataSource1.Delete();
txtEmail.Text = "";
lblError.Text = "Email has been removed";
}
catch
{
lblError.Text = "Email doesn't exist";
}
}
Thanks for all your help
AnswerRe: Newbie Help Pin
Vimalsoft(Pty) Ltd23-Oct-09 3:17
professionalVimalsoft(Pty) Ltd23-Oct-09 3:17 
GeneralRe: Newbie Help Pin
kruegersck23-Oct-09 3:24
kruegersck23-Oct-09 3:24 
GeneralRe: Newbie Help Pin
Vimalsoft(Pty) Ltd23-Oct-09 3:30
professionalVimalsoft(Pty) Ltd23-Oct-09 3:30 
QuestionMulti level marketing mlm asp.net Tree structure logic Pin
kirankkk200923-Oct-09 2:30
kirankkk200923-Oct-09 2:30 
AnswerRe: Multi level marketing mlm asp.net Tree structure logic PinPopular
Not Active23-Oct-09 2:36
mentorNot Active23-Oct-09 2:36 
AnswerRe: Multi level marketing mlm asp.net Tree structure logic Pin
Ashfield23-Oct-09 4:05
Ashfield23-Oct-09 4:05 
GeneralRe: Multi level marketing mlm asp.net Tree structure logic Pin
kirankkk20094-Nov-09 18:45
kirankkk20094-Nov-09 18:45 
GeneralRe: Multi level marketing mlm asp.net Tree structure logic Pin
kirankkk20094-Nov-09 18:47
kirankkk20094-Nov-09 18:47 
AnswerRe: Multi level marketing mlm asp.net Tree structure logic Pin
Christian Graus23-Oct-09 10:18
protectorChristian Graus23-Oct-09 10:18 
GeneralWeb Animation in ASP.NET! Pin
tunsten23-Oct-09 2:10
tunsten23-Oct-09 2:10 
GeneralRe: Web Animation in ASP.NET! Pin
sashidhar23-Oct-09 2:22
sashidhar23-Oct-09 2:22 
QuestionAllow users to customize your site to suite their taste! Pin
tunsten23-Oct-09 1:21
tunsten23-Oct-09 1:21 
AnswerRe: Allow users to customize your site to suite their taste! Pin
Not Active23-Oct-09 2:34
mentorNot Active23-Oct-09 2:34 
AnswerRe: Allow users to customize your site to suite their taste! Pin
JimBob SquarePants23-Oct-09 9:23
JimBob SquarePants23-Oct-09 9:23 
QuestionPublication (web): Object reference not set to an instance of an object. Pin
Colin Angus Mackay23-Oct-09 0:59
Colin Angus Mackay23-Oct-09 0:59 
AnswerRe: Publication (web): Object reference not set to an instance of an object. Pin
Vimalsoft(Pty) Ltd23-Oct-09 1:41
professionalVimalsoft(Pty) Ltd23-Oct-09 1:41 
GeneralRe: Publication (web): Object reference not set to an instance of an object. Pin
Colin Angus Mackay23-Oct-09 2:24
Colin Angus Mackay23-Oct-09 2:24 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.