Showing posts with label text. Show all posts
Showing posts with label text. Show all posts

Thursday, March 29, 2012

Passing values from a datagrid w/ a HyperLinkColumn

I have successfully populated my datagrid. It consists of only one column. THis column is a link. What I am trying to do is send the text of the link (also what is pulled from the DB) to the aspx page that the link submits to.

I'm open to all suggestions as I'm new and trying to learn all different ways possible.

Thanks!

HDYour column should look like this :


<Columns>
<asp:HyperLinkColumn DataNavigateUrlField="DepartmentID" DataNavigateUrlFormatString="default.aspx?DepartmentID={0}"
DataTextField="DepartmentName" HeaderText="Departments :" ItemStyle-CssClass="side "></asp:HyperLinkColumn>
</Columns>

The DataNavigateUrl field gets placed where the {0} is in the DataNavigateUrlFormatString. DataText is the displayed link text.

On the next page you can pick up the value using Request.Params("DepartmentID")

Simon
Great thanks. However I am receiving the following where I try to do the Request.Params("fieldName").


"'System.Web.HttpRequest.Params' denotes a 'property' where a 'method' was expected"

The line of code throwing the error is :


TextBox1.Text = Request.Params("SelectedCategory");

Thanks for your help, and forgive the stupid questions.

HD
Nevermind. I figured it out. I changed the line of code to

Request.Params.Get("SelectedCategory")

HD

Passing values from labels to text boxes via session variables

I'm passing label values from one page to text boxes in another page for user update. I'm using session variables, but I have been unable to display the passed values in the receiving text boxes. I'm not sure if the syntax is wrong or if the constructs are inappropriate. I'm new and need help.

<code>
SENDING PAGE:

<%@dotnet.itags.org. Page Language="vb" %>
<script runat="server"
Sub doSubmit(Source as Object, E as EventArgs)
Context.Items.Add("first", txtFirst.text)
Context.Items.Add("last", txtLast.text)
Server.Transfer("3.aspx")
End Sub

</script>
<html
<head>
<title>1.aspx</title>
</head
<body
<form id="form1" runat="server">
First Name: <asp:TextBox id="txtFirst" runat="server" /><br>
Last Name: <asp:TextBox id="txtLast" runat="server" />
<asp:Button id="button1" Text="Submit" onclick="doSubmit" runat="server" />
</Form>
</body>
</html
RECEIVING PAGE:

<%@dotnet.itags.org. Page Language="vb" %>
<script runat="server"
Sub Page_Load(Source as Object, E as EventArgs)

label1.text = "The Name you entered was : " & Context.Items("first") & " " & _
Context.Items("last")
textbox1.text = Context.Items("First")
textbox2.text = Context.Items("Last")

End Sub

</script>
<html>
<head>
<title>Second Page</title>
<asp:Label ID="label1" runat="server" />
</head>
<body>
<form name="Form1" runat="server">
<asp:TextBox id="textBox1" Text='<%# "textbox1" %>' runat="server"></asp:TextBox>
<asp:TextBox id="textBox2" Text='<%# "textbox2" %>' runat="server"></asp:TextBox>
</form>
</body>
</htmlIn the recieving pae's load event you're setting the value of the textbox so you don't need to bind the text box's value to itself (so just leave out the "Text=' etc." attribute).

Also, the items collection is case sensitive. You're adding items as "first" and "last" but you're trying to retrieve values from "First" and "Last". Choose a case and stick with it and the problem is resolved.
you made my day Chapel21. thanx for the prompt response and the explanation given, it makes a bit clearer what each line of code does.

sometimes I think I should've studied CGI scripting 5 years ago, when i had time to invest. by now, ASP .NET should've been simpler to understand and use, or may be not.. thanx again,

Monday, March 26, 2012

passing values to showmodal dialog

I have parent.aspx web page from which I call a modal dialog (child.aspx via
showmodaldialog). I'd like to populate two text boxes, <asp:TextBox id=txt
_HN> on the child form with data from the caller.
for parent.aspx....
<script> block
function UpdH(title,horse)
{
var iParms=new Object();
iParms.Name=horse;
...}
for child.aspx...
<script> block
I've tried "document.getElementById('txt_HN').value=iParms.Horse;" within ch
ild.aspx form - but get error "document.getElementbyId(...) is null or not a
n object". How do I do this?David,
Try dialogArguments.window.document.getElementById....
using the following to open your window in java script:
var TestWindow = new Object();
TestWindow.caller = window.showModalDialog(URLstr, window, sFeatures);
replacing the parameters there with whatever you use as appropriate.
Raymond Lewallen
"DavidS" <DavidS@.discussions.microsoft.com> wrote in message
news:564EE97A-8C7D-4E35-B034-99BB78A95904@.microsoft.com...
> I have parent.aspx web page from which I call a modal dialog (child.aspx
via showmodaldialog). I'd like to populate two text boxes, <asp:TextBox
id=txt_HN> on the child form with data from the caller.
> for parent.aspx....
> <script> block
> function UpdH(title,horse)
> {
> var iParms=new Object();
> iParms.Name=horse;
> ...}
> for child.aspx...
> <script> block
> I've tried "document.getElementById('txt_HN').value=iParms.Horse;" within
child.aspx form - but get error "document.getElementbyId(...) is null or not
an object". How do I do this?

passing values to showmodal dialog

I have parent.aspx web page from which I call a modal dialog (child.aspx via showmodaldialog). I'd like to populate two text boxes, <asp:TextBox id=txt_HN> on the child form with data from the caller.
for parent.aspx....
<script> block
function UpdH(title,horse)
{
var iParms=new Object();
iParms.Name=horse;
...}
for child.aspx...
<script> block
I've tried "document.getElementById('txt_HN').value=iParms.Hor se;" within child.aspx form - but get error "document.getElementbyId(...) is null or not an object". How do I do this?David,

Try dialogArguments.window.document.getElementById... .

using the following to open your window in javascript:

var TestWindow = new Object();
TestWindow.caller = window.showModalDialog(URLstr, window, sFeatures);

replacing the parameters there with whatever you use as appropriate.

Raymond Lewallen

"DavidS" <DavidS@.discussions.microsoft.com> wrote in message
news:564EE97A-8C7D-4E35-B034-99BB78A95904@.microsoft.com...
> I have parent.aspx web page from which I call a modal dialog (child.aspx
via showmodaldialog). I'd like to populate two text boxes, <asp:TextBox
id=txt_HN> on the child form with data from the caller.
> for parent.aspx....
> <script> block
> function UpdH(title,horse)
> {
> var iParms=new Object();
> iParms.Name=horse;
> ...}
> for child.aspx...
> <script> block
> I've tried "document.getElementById('txt_HN').value=iParms.Hor se;" within
child.aspx form - but get error "document.getElementbyId(...) is null or not
an object". How do I do this?

Saturday, March 24, 2012

Passing Variables

I have a asp page named welcome.asp where I have three input text
fields and a button named submit.
When I fill text in these text fields and click on button it passes
all those information to another aspx page.
the difference is my source page is written in classic asp and my
destination page is aspx.
Is this possible to pass values from asp page to aspx page. If so,
could you please send me xsom code.

Thanks,On Jun 11, 11:41 pm, bba...@.yahoo.com wrote:

Quote:

Originally Posted by

I have a asp page named welcome.asp where I have three input text
fields and a button named submit.
When I fill text in these text fields and click on button it passes
all those information to another aspx page.
the difference is my source page is written in classic asp and my
destination page is aspx.
Is this possible to pass values from asp page to aspx page. If so,
could you please send me xsom code.
>
Thanks,


Request.Form["text_field_from_asp"] ?
On Jun 11, 2:45 pm, Alexey Smirnov <alexey.smir...@.gmail.comwrote:

Quote:

Originally Posted by

On Jun 11, 11:41 pm, bba...@.yahoo.com wrote:
>

Quote:

Originally Posted by

I have a asp page named welcome.asp where I have three input text
fields and a button named submit.
When I fill text in these text fields and click on button it passes
all those information to another aspx page.
the difference is my source page is written in classic asp and my
destination page is aspx.
Is this possible to pass values from asp page to aspx page. If so,
could you please send me xsom code.


>

Quote:

Originally Posted by

Thanks,


>
Request.Form["text_field_from_asp"] ?


Is Request.form should be in destination web form or source webform.
<bbawa1@.yahoo.comwrote in message
news:1181603240.417819.11150@.a26g2000pre.googlegro ups.com...

Quote:

Originally Posted by

On Jun 11, 2:45 pm, Alexey Smirnov <alexey.smir...@.gmail.comwrote:

Quote:

Originally Posted by

>On Jun 11, 11:41 pm, bba...@.yahoo.com wrote:
>>

Quote:

Originally Posted by

I have a asp page named welcome.asp where I have three input text
fields and a button named submit.
When I fill text in these text fields and click on button it passes
all those information to another aspx page.
the difference is my source page is written in classic asp and my
destination page is aspx.
Is this possible to pass values from asp page to aspx page. If so,
could you please send me xsom code.


>>

Quote:

Originally Posted by

Thanks,


>>
>Request.Form["text_field_from_asp"] ?


>
Is Request.form should be in destination web form or source webform.
>


http://groups.google.com/group/micr...5addf17bc2a9da2

Passing Variables

I have a asp page named welcome.asp where I have three input text
fields and a button named submit.
When I fill text in these text fields and click on button it passes
all those information to another aspx page.
the difference is my source page is written in classic asp and my
destination page is aspx.
Is this possible to pass values from asp page to aspx page. If so,
could you please send me xsom code.
Thanks,On Jun 11, 11:41 pm, bba...@.yahoo.com wrote:
> I have a asp page named welcome.asp where I have three input text
> fields and a button named submit.
> When I fill text in these text fields and click on button it passes
> all those information to another aspx page.
> the difference is my source page is written in classic asp and my
> destination page is aspx.
> Is this possible to pass values from asp page to aspx page. If so,
> could you please send me xsom code.
> Thanks,
Request.Form["text_field_from_asp"] ?
On Jun 11, 2:45 pm, Alexey Smirnov <alexey.smir...@.gmail.com> wrote:
> On Jun 11, 11:41 pm, bba...@.yahoo.com wrote:
>
>
> Request.Form["text_field_from_asp"] ?
Is Request.form should be in destination web form or source webform.
<bbawa1@.yahoo.com> wrote in message
news:1181603240.417819.11150@.a26g2000pre.googlegroups.com...
> On Jun 11, 2:45 pm, Alexey Smirnov <alexey.smir...@.gmail.com> wrote:
> Is Request.form should be in destination web form or source webform.
>
http://groups.google.com/group/micr...5addf17bc2a9da2

Passing variables between pages

Hello, I have a page where I ask the user to enter text into a text box, and clicking a button which sends them to another page. I am using the code (in C#):

void Button1_Click(object sender, EventArgs e)
{
Server.Transfer("results.aspx?q=" + TextBox1.Text);
}

which works fine, but how would I call upon the variable in the results page? Also, how could I check the TextBox1.Text to see if it is blank? I tried:

If (TextBox1.Text = "")

but it tells me that I can't change from a string to a bool. Any help would be great, thanks.Well, in VB to check for empty strings I do this.

If TextBox1.Text Is String.Empty Then
' Yell at the person for not entering any text
Else
' Thank them for entering something
End If

Wednesday, March 21, 2012

Passing Variables to another webpage

Pls. help!!!!!!! jas started in ASP.NET.

How Can I Pass the text in a textbox to another webpage?
Thanks in advance . . .You have a number of ways in .NET to pass information but the whole point of .NET is that controls (textboxes) are programmatically accessible so in your postback you basically just say
sString = textbox1.text

However, if you're wanting to pass it to a completely different page, then you'd need to redirect and use either querystring, session or global module (type properties0 to hold the data.

eg

Sub onButtonClick (...)
sString = textbox1.text
response.redirect("myNewPage.aspx?ss=" & sString & "")

End sub
Take a look at the Global.asax File.

//-- define the vaiable

public class Global : System.Web.HttpApplication
{

//...

public static int anwStatus;

//...

}

//-- use the variable, e.g.
Global.anwStatus = 1;

by
Andreas

Passing variables, please please help :)

I wrote a much more complicated version of this question earlier and no one answered so i thought i'd simplify it. I want to have a text box and a submit button on page1.aspx. I want a user to type something into the textbox and when they click on the submit button to get passed to page2.aspx?keyword=[value of textbox]. I have tried about five million different ways, html forms don't seem to work because i'm using a master page and i can't get anything else to do it. Please please please could someone help me before i lose all sense of reality :)

Thanks,

Dave

Protected Sub button_click(...) Response.Redirect("page2.aspx?text=" & textbox1.text)End Sub

I cannot begin to express my thanks for that, it is unbelivable, but i have been trying to get it to do that for hours and have been on about 8 forums chatting with people all over the place and tried pages of code. It seemed strange it wasn't possible to do it very simply with hardly any code and you have just shown me how. You may actually be solely responsible for preventing me from losing my sanity and for that i am truely grateful. If i can ever do anything in return then please don't hesitate to ask, although given i couldn't even work that out i wouldn't be too sure you'll get anything useful in response! :)

Once again thank you so, so much, you are an absolute and complete life saver.

Dave

Friday, March 16, 2012

password attempts

have a username and opassword text boxes and one login button. When I
type password it checks three times weather my username and password
is correct or not. After 3 failed attempts it gives me message that
Notify your administrator.
I used form Authnication. How can I count weather user attempts 3
times. My username and password is stored in databaseThe easiest way is to set up a session variable and increment:
if(failedLogin)
Session("failedAttempts") = int.Parse(Session("FailedAttempts")) + 1;
You can then disable the account in the database when this hits three and
any time they try to log in after that kicks them.
A more full method is to have failed attempts in the database and increment
each time they fail, reset to 0 if succesful. If you like this model, the
easiest way to get it is to use the ASP.NET built in membership model. It
automatically does this for you.
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA
http://gregorybeamer.spaces.live.com
****************************************
*****
Think outside the box!
****************************************
*****
<bbawa1@.yahoo.com> wrote in message
news:1177104579.742843.13100@.q75g2000hsh.googlegroups.com...
> have a username and opassword text boxes and one login button. When I
> type password it checks three times weather my username and password
> is correct or not. After 3 failed attempts it gives me message that
> Notify your administrator.
> I used form Authnication. How can I count weather user attempts 3
> times. My username and password is stored in database
>

password attempts

have a username and opassword text boxes and one login button. When I
type password it checks three times weather my username and password
is correct or not. After 3 failed attempts it gives me message that
Notify your administrator.

I used form Authnication. How can I count weather user attempts 3
times. My username and password is stored in databaseThe easiest way is to set up a session variable and increment:

if(failedLogin)
Session("failedAttempts") = int.Parse(Session("FailedAttempts")) + 1;

You can then disable the account in the database when this hits three and
any time they try to log in after that kicks them.

A more full method is to have failed attempts in the database and increment
each time they fail, reset to 0 if succesful. If you like this model, the
easiest way to get it is to use the ASP.NET built in membership model. It
automatically does this for you.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA
http://gregorybeamer.spaces.live.com
*********************************************
Think outside the box!
*********************************************
<bbawa1@.yahoo.comwrote in message
news:1177104579.742843.13100@.q75g2000hsh.googlegro ups.com...

Quote:

Originally Posted by

have a username and opassword text boxes and one login button. When I
type password it checks three times weather my username and password
is correct or not. After 3 failed attempts it gives me message that
Notify your administrator.
>
I used form Authnication. How can I count weather user attempts 3
times. My username and password is stored in database
>

Password field

In ASP.Net I would like to create a text box that is a Password Field.
How do I do that ?
When I use the Textbox Field (from Toolbox - Standard), I did not find
anything there that can make it a password field.
When I use the Input (Password) Field (From Toolbox - HTML), in my
Submit command button when I do Request.Form("txtPassword") or
Request.QueryString("txtPassword") it returns nothing.

This is from Page1.aspx
<input id="txtPassword" type="password" />

This is from Page1.aspx.vb:
Protected Sub cmdSubmit_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles cmdSubmit.Click
sPassword = Request.Form("txtPassword") --nothing

Thank you.<fiefie.niles@.gmail.comwrote in message
news:1177277182.866667.28220@.b75g2000hsg.googlegro ups.com...

Quote:

Originally Posted by

In ASP.Net I would like to create a text box that is a Password Field.
How do I do that ?


<asp:TextBox ID="txtPassword" runat="server" TextMode="Password" />
When I click on the hyperlink you wrote
news:1177277182.866667.28220@.b75g2000hsg.googlegro ups.com...
it says "Page not found".
Can you please retype the link ? Thank you very much.

On Apr 22, 4:43 pm, "Mark Rae" <m...@.markNOSPAMrae.netwrote:

Quote:

Originally Posted by

<fiefie.ni...@.gmail.comwrote in message
>
news:1177277182.866667.28220@.b75g2000hsg.googlegro ups.com...
>

Quote:

Originally Posted by

In ASP.Net I would like to create a text box that is a Password Field.
How do I do that ?


>
<asp:TextBox ID="txtPassword" runat="server" TextMode="Password" />


You can only click on that hyperlink from a newsreader, not from a browser.

Notice the news: protocol

Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en espaol : http://asp.net.do/foros/
===================================
<fiefie.niles@.gmail.comwrote in message
news:1177278845.344621.129990@.y80g2000hsf.googlegr oups.com...

Quote:

Originally Posted by

When I click on the hyperlink you wrote
news:1177277182.866667.28220@.b75g2000hsg.googlegro ups.com...
it says "Page not found".
Can you please retype the link ? Thank you very much.
>
On Apr 22, 4:43 pm, "Mark Rae" <m...@.markNOSPAMrae.netwrote:

Quote:

Originally Posted by

><fiefie.ni...@.gmail.comwrote in message
>>
>news:1177277182.866667.28220@.b75g2000hsg.googlegro ups.com...
>>

Quote:

Originally Posted by

In ASP.Net I would like to create a text box that is a Password Field.
How do I do that ?


>>
><asp:TextBox ID="txtPassword" runat="server" TextMode="Password" />


>
>


<fiefie.niles@.gmail.comwrote in message
news:1177278845.344621.129990@.y80g2000hsf.googlegr oups.com...

Quote:

Originally Posted by

When I click on the hyperlink you wrote


What hyperlink...?
See my earlier reply, MArk.

He means the news: protocol hyperlink which is quoted
in your reply because you used a newsreader to reply to him.

He's using a browser...and the news: protocol doesn't work in browsers
unless it also has the double slashes and the server's address.

Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en espaol : http://asp.net.do/foros/
===================================
"Mark Rae" <mark@.markNOSPAMrae.netwrote in message news:O5dS0pShHHA.1312@.TK2MSFTNGP03.phx.gbl...

Quote:

Originally Posted by

<fiefie.niles@.gmail.comwrote in message
news:1177278845.344621.129990@.y80g2000hsf.googlegr oups.com...
>

Quote:

Originally Posted by

>When I click on the hyperlink you wrote


>
What hyperlink...?
>


"Juan T. Llibre" <nomailreplies@.nowhere.comwrote in message
news:ezMak%23ShHHA.3960@.TK2MSFTNGP02.phx.gbl...

Quote:

Originally Posted by

See my earlier reply, MArk.
>
He means the news: protocol hyperlink which is quoted
in your reply because you used a newsreader to reply to him.
>
He's using a browser...and the news: protocol doesn't work in browsers
unless it also has the double slashes and the server's address.


Ah right...
Oh, I see your reply. I got it. Sorry about the confusion.
That works !
Thanks a lot.

On Apr 22, 5:51 pm, "Mark Rae" <m...@.markNOSPAMrae.netwrote:

Quote:

Originally Posted by

"Juan T. Llibre" <nomailrepl...@.nowhere.comwrote in messagenews:ezMak%23ShHHA.3960@.TK2MSFTNGP02.phx.gb l...
>

Quote:

Originally Posted by

See my earlier reply, MArk.


>

Quote:

Originally Posted by

He means the news: protocol hyperlink which is quoted
in your reply because you used a newsreader to reply to him.


>

Quote:

Originally Posted by

He's using a browser...and the news: protocol doesn't work in browsers
unless it also has the double slashes and the server's address.


>
Ah right...

Password Field and Session Vars

Hey, I'm not sure what happened, but I ran into a simple problem I can't figure out.

All I'm trying to do is read two text boxes, txtUserEmail and txtUserPassword. I then take the txtUserEmail value and pass it into a stored proc, which matches it against an Email address in the MSDE. The stored proc returns the UserEmail, UserPassword, UserGroup (role) and UserEmailConfirm.

All I wanted to do is check txtUserEmail.text and txtUserPassword vs the UserEmail and UserPassword fields in my table that I'm getting back from the stored proc. Based on a match, I want to set a couple of Session vars.

fnReturnDataSet is in another module. It takes the stored proc call and returns the data set with the appropriate information.

The problem is that the Sub is skipping over the FOR loop and I'm not sure why. I know I'm only returning one row, but it's easy to just use this temeplate to get the dataset since it's working on 4 other pages I wrote.

If anyone could give me a hint what's wrong, I'd appriciate it.

--------------

Protected Sub btnUserLogin_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnUserLogin.Click
Dim strUserEmail, strUserPassword As String
Dim objSQL As String
Dim dsUserInfo As DataSet
Dim row As DataRow

strUserEmail = txtUserEmail.Text
strUserPassword = txtUserPassword.Text

objSQL = "EXECUTE spValidateUser '" & strUserEmail & "'"
dsUserInfo = fnReturnDataSet(objSQL)

For Each row In dsUserInfo.Tables("dtReturnedTable").Rows
If (row("UserEmail") = strUserEmail) And (row("UserPassword") = strUserPassword) And (row("UserEmailConfirm") = "yes") Then
Session("User") = row("UserEmail")
Session("UserGroup") = row("UserGroup")
lblConfirm.Text = "You are now logged in"
Else
lblError.Text = "The username or password provided are not valid"
End If
Next
End Subhello, have u tried to add
row("UserEmail").ToString() = strUserEmail ...

try it.
I actually figured everything out, but thank you for the suggestion.

I also found an article with some encryption classes to use:
http://www.15seconds.com/issue/021210.htm

I have the cookie encrypted as far as I can tell. I set one key to the UserName and a second to a UserRole. I just need to encrypt the passwords in my SQL database and I should be all set.

Eric

Password field

In ASP.Net I would like to create a text box that is a Password Field.
How do I do that ?
When I use the Textbox Field (from Toolbox - Standard), I did not find
anything there that can make it a password field.
When I use the Input (Password) Field (From Toolbox - HTML), in my
Submit command button when I do Request.Form("txtPassword") or
Request.QueryString("txtPassword") it returns nothing.
This is from Page1.aspx
<input id="txtPassword" type="password" />
This is from Page1.aspx.vb:
Protected Sub cmdSubmit_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles cmdSubmit.Click
sPassword = Request.Form("txtPassword") --> nothing
Thank you.<fiefie.niles@.gmail.com> wrote in message
news:1177277182.866667.28220@.b75g2000hsg.googlegroups.com...

> In ASP.Net I would like to create a text box that is a Password Field.
> How do I do that ?
<asp:TextBox ID="txtPassword" runat="server" TextMode="Password" />
When I click on the hyperlink you wrote
news:1177277182.866667.28220@.b75g2000hsg.googlegroups.com...
it says "Page not found".
Can you please retype the link ? Thank you very much.
On Apr 22, 4:43 pm, "Mark Rae" <m...@.markNOSPAMrae.net> wrote:
> <fiefie.ni...@.gmail.com> wrote in message
> news:1177277182.866667.28220@.b75g2000hsg.googlegroups.com...
>
> <asp:TextBox ID="txtPassword" runat="server" TextMode="Password" />
You can only click on that hyperlink from a newsreader, not from a browser.
Notice the news: protocol
Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en espaol : http://asp.net.do/foros/
===================================
<fiefie.niles@.gmail.com> wrote in message
news:1177278845.344621.129990@.y80g2000hsf.googlegroups.com...
> When I click on the hyperlink you wrote
> news:1177277182.866667.28220@.b75g2000hsg.googlegroups.com...
> it says "Page not found".
> Can you please retype the link ? Thank you very much.
> On Apr 22, 4:43 pm, "Mark Rae" <m...@.markNOSPAMrae.net> wrote:
>
<fiefie.niles@.gmail.com> wrote in message
news:1177278845.344621.129990@.y80g2000hsf.googlegroups.com...

> When I click on the hyperlink you wrote
What hyperlink...?
See my earlier reply, MArk.
He means the news: protocol hyperlink which is quoted
in your reply because you used a newsreader to reply to him.
He's using a browser...and the news: protocol doesn't work in browsers
unless it also has the double slashes and the server's address.
Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en espaol : http://asp.net.do/foros/
===================================
"Mark Rae" <mark@.markNOSPAMrae.net> wrote in message news:O5dS0pShHHA.1312@.TK2MSFTNGP03.phx
.gbl...
> <fiefie.niles@.gmail.com> wrote in message
> news:1177278845.344621.129990@.y80g2000hsf.googlegroups.com...
>
> What hyperlink...?
>
"Juan T. Llibre" <nomailreplies@.nowhere.com> wrote in message
news:ezMak%23ShHHA.3960@.TK2MSFTNGP02.phx.gbl...

> See my earlier reply, MArk.
> He means the news: protocol hyperlink which is quoted
> in your reply because you used a newsreader to reply to him.
> He's using a browser...and the news: protocol doesn't work in browsers
> unless it also has the double slashes and the server's address.
Ah right...
Oh, I see your reply. I got it. Sorry about the confusion.
That works !
Thanks a lot.
On Apr 22, 5:51 pm, "Mark Rae" <m...@.markNOSPAMrae.net> wrote:
> "Juan T. Llibre" <nomailrepl...@.nowhere.com> wrote in messagenews:ezMak%23
ShHHA.3960@.TK2MSFTNGP02.phx.gbl...
>
>
>
> Ah right...

password field: Syntax error in INSERT INTO statement.

Hello,
I am trying to execute ADO.NET INSERT statement where one of the
fields
is coming from a password HTML control. When I access the text with
password.Value and print with Response.Write so as to check that it
is working correctly it displays just fine. However, whenever I
include the password field in one of the SQL INSERT statement's
fields I get the following error:
Exception Details: System.Data.OleDb.OleDbException: Syntax error in
INSERT INTO statement.
Line 85: cmd.ExecuteNonQuery();
When I delete the password field from the insert statement things work
fine (so the problem is no longer related to NTFS file permissions).
Any ideas on how to solve this problem would be greatly appreciated.
Best Regards,
NeilNeil, it's difficult to pinpoint your problem without seeing some code; but
here are a few ideas to get you started;
If you're using a WebControls textbox (and not an HtmlControls input box),
then the correct accessor would be something like txtPassword.Text
Triple-check your SQL. Try modifying it so that the value you're entering
in the textbox is manually assigned to the SqlParam (or embedded in your sql
string, etc). That will help you debug your SQL, your schema, etc while
removing the textbox from the equation.
Try very simple passwords, e.g. "a". If that succeeds, you might be having
a problem with unescaped apostrophes or something similar.
If you can, display the generated Sql in a Trace.Write or a Response.Write,
and copy/paste it into your Sql tool to test it manually.
Best of luck,
/// M
"Neil Zanella" <nzanella@.gmail.com> wrote in message
news:1ac72686.0501221942.349922c2@.posting.google.com...
> Hello,
> I am trying to execute ADO.NET INSERT statement where one of the
> fields
> is coming from a password HTML control. When I access the text with
> password.Value and print with Response.Write so as to check that it
> is working correctly it displays just fine. However, whenever I
> include the password field in one of the SQL INSERT statement's
> fields I get the following error:
> Exception Details: System.Data.OleDb.OleDbException: Syntax error in
> INSERT INTO statement.
> Line 85: cmd.ExecuteNonQuery();
> When I delete the password field from the insert statement things work
> fine (so the problem is no longer related to NTFS file permissions).
> Any ideas on how to solve this problem would be greatly appreciated.
> Best Regards,
> Neil
Hello,
Thank you for your reply. I have already tried everything
you suggested. I also had a problem with calling
Response.Write to debug my SQL query as
whenever I use it the parameter holders
which begin with @. are not substituted
when I call Response.Write (is there
some special method I can call on
OleDbCommand to print the actual
query with the parameters
substituted in?)
Anyways, here was my problem: as strange as
it may sound, I renamed a field called "password"
in MS Access to "foo" and did the same in the
query contained in the code. I don't know how
come but that fixed it. Is there something
special about calling a table's field
"password" in MS Access which
causes the query error I was
experiencing'
Thanks,
Neil
It might be a reserved word in Access. In Sql Server you can use most
reserved words as column names, but you reference them in your sql using
[brackets].
Since you've identified it as an Access or .NET->Access issue, I'd also try
seaching some of those newsgroups.
<nzanella@.gmail.com> wrote in message
news:1106607939.521494.187670@.f14g2000cwb.googlegroups.com...
> Hello,
> Thank you for your reply. I have already tried everything
> you suggested. I also had a problem with calling
> Response.Write to debug my SQL query as
> whenever I use it the parameter holders
> which begin with @. are not substituted
> when I call Response.Write (is there
> some special method I can call on
> OleDbCommand to print the actual
> query with the parameters
> substituted in?)
> Anyways, here was my problem: as strange as
> it may sound, I renamed a field called "password"
> in MS Access to "foo" and did the same in the
> query contained in the code. I don't know how
> come but that fixed it. Is there something
> special about calling a table's field
> "password" in MS Access which
> causes the query error I was
> experiencing'
> Thanks,
> Neil
>

password field: Syntax error in INSERT INTO statement.

Hello,

I am trying to execute ADO.NET INSERT statement where one of the
fields
is coming from a password HTML control. When I access the text with
password.Value and print with Response.Write so as to check that it
is working correctly it displays just fine. However, whenever I
include the password field in one of the SQL INSERT statement's
fields I get the following error:

Exception Details: System.Data.OleDb.OleDbException: Syntax error in
INSERT INTO statement.

Line 85: cmd.ExecuteNonQuery();

When I delete the password field from the insert statement things work
fine (so the problem is no longer related to NTFS file permissions).

Any ideas on how to solve this problem would be greatly appreciated.

Best Regards,

NeilNeil, it's difficult to pinpoint your problem without seeing some code; but
here are a few ideas to get you started;

If you're using a WebControls textbox (and not an HtmlControls input box),
then the correct accessor would be something like txtPassword.Text

Triple-check your SQL. Try modifying it so that the value you're entering
in the textbox is manually assigned to the SqlParam (or embedded in your sql
string, etc). That will help you debug your SQL, your schema, etc while
removing the textbox from the equation.

Try very simple passwords, e.g. "a". If that succeeds, you might be having
a problem with unescaped apostrophes or something similar.

If you can, display the generated Sql in a Trace.Write or a Response.Write,
and copy/paste it into your Sql tool to test it manually.

Best of luck,

/// M

"Neil Zanella" <nzanella@.gmail.com> wrote in message
news:1ac72686.0501221942.349922c2@.posting.google.c om...
> Hello,
> I am trying to execute ADO.NET INSERT statement where one of the
> fields
> is coming from a password HTML control. When I access the text with
> password.Value and print with Response.Write so as to check that it
> is working correctly it displays just fine. However, whenever I
> include the password field in one of the SQL INSERT statement's
> fields I get the following error:
> Exception Details: System.Data.OleDb.OleDbException: Syntax error in
> INSERT INTO statement.
> Line 85: cmd.ExecuteNonQuery();
> When I delete the password field from the insert statement things work
> fine (so the problem is no longer related to NTFS file permissions).
> Any ideas on how to solve this problem would be greatly appreciated.
> Best Regards,
> Neil
Hello,

Thank you for your reply. I have already tried everything
you suggested. I also had a problem with calling
Response.Write to debug my SQL query as
whenever I use it the parameter holders
which begin with @. are not substituted
when I call Response.Write (is there
some special method I can call on
OleDbCommand to print the actual
query with the parameters
substituted in?)

Anyways, here was my problem: as strange as
it may sound, I renamed a field called "password"
in MS Access to "foo" and did the same in the
query contained in the code. I don't know how
come but that fixed it. Is there something
special about calling a table's field
"password" in MS Access which
causes the query error I was
experiencing??

Thanks,

Neil
It might be a reserved word in Access. In Sql Server you can use most
reserved words as column names, but you reference them in your sql using
[brackets].

Since you've identified it as an Access or .NET->Access issue, I'd also try
seaching some of those newsgroups.

<nzanella@.gmail.com> wrote in message
news:1106607939.521494.187670@.f14g2000cwb.googlegr oups.com...
> Hello,
> Thank you for your reply. I have already tried everything
> you suggested. I also had a problem with calling
> Response.Write to debug my SQL query as
> whenever I use it the parameter holders
> which begin with @. are not substituted
> when I call Response.Write (is there
> some special method I can call on
> OleDbCommand to print the actual
> query with the parameters
> substituted in?)
> Anyways, here was my problem: as strange as
> it may sound, I renamed a field called "password"
> in MS Access to "foo" and did the same in the
> query contained in the code. I don't know how
> come but that fixed it. Is there something
> special about calling a table's field
> "password" in MS Access which
> causes the query error I was
> experiencing??
> Thanks,
> Neil

Password Fields

Does any one know how to put text into a password field.> Does any one know how to put text into a password field.
Same as any other text field... < ... value="hello world" ... >
> Same as any other text field... < ... value="hello world" ... >
I've got it sussed now, thanks.
You idea did not work, although the text property is set, it does not
display it. Its neccessary to set the text property, and use
txtBox.Attributes.Add("Value",someString)
With both set it displays the asterisks and stores the Text value.
Setting the Text property of the password-mode text box may not work. You
have to use the Attributes collection of the textbox.
txtPwd.Text = "mypwd"; // This will not pre-populate the password field
txtPwd.Attributes.Add ("VALUE", "mypwd"); // but this will...
However, sending a default password is not recommended.
HTH
"Josh" <someone@.microsoft.com> wrote in message
news:OVD$hDtpEHA.1160@.tk2msftngp13.phx.gbl...
Does any one know how to put text into a password field.

Password Fields

Does any one know how to put text into a password field.> Does any one know how to put text into a password field.

Same as any other text field... < ... value="hello world" ...
> Same as any other text field... < ... value="hello world" ...
I've got it sussed now, thanks.

You idea did not work, although the text property is set, it does not
display it. Its neccessary to set the text property, and use

txtBox.Attributes.Add("Value",someString)

With both set it displays the asterisks and stores the Text value.
Setting the Text property of the password-mode text box may not work. You
have to use the Attributes collection of the textbox.

txtPwd.Text = "mypwd"; // This will not pre-populate the password field
txtPwd.Attributes.Add ("VALUE", "mypwd"); // but this will...

However, sending a default password is not recommended.

HTH

"Josh" <someone@.microsoft.com> wrote in message
news:OVD$hDtpEHA.1160@.tk2msftngp13.phx.gbl...
Does any one know how to put text into a password field.