For Programmers: Free Programming Magazines  


Home > Archive > Visual Studio > May 2006 > Please give me Parameter Examples in ASP.net 2









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Please give me Parameter Examples in ASP.net 2
Phillip Vong

2006-04-07, 7:03 pm

Please some one help me. I'm trying to learn something very very simple and
I just have to see how it's done. If you're using VS2005 or VWD, please
create this very simple asp.net page for me and just past the whole source
code so I can see how it's done. People keep giving me a little code here
and there and say try this or that, but none of it worked for me. I just
need to see the whole thing.

This is all i want to do.
DB = SQL northwind
Table = Customer
Column = Contact Name
One Textbox = textbox1 with default value of "c"

I just want to see how you can pass a variable to the Select using Like
that contains the value in the textbox1.text. The result will show on a
simple GridView. I know I basically have to do it with parameters and I've
read a lot and tried a lot and can not get it to work. This is the Select
from VS2005. Can someone tell me if this is correct? My peramter name is
@test. The SQLDataSource is fine.

SelectCommand="SELECT [ContactName] FROM [Customers] WHERE ([ContactName]
LIKE '%' + @test + '%')"

Please please please create this simple aspx and paste the whole source code
so I can see how it's done.

Thanks in advance.

Phil







Phillip Vong

2006-05-16, 7:11 pm

Got it. I put this in the OnClick event.

FormView1.FindControl("updatebutton").Visible = True







"Phillip Vong" <phillip_vong*at*yahoo*dot*com> wrote in message
news:%234CXAelWGHA.752@TK2MSFTNGP02.phx.gbl...
> Please some one help me. I'm trying to learn something very very simple
> and
> I just have to see how it's done. If you're using VS2005 or VWD, please
> create this very simple asp.net page for me and just past the whole source
> code so I can see how it's done. People keep giving me a little code here
> and there and say try this or that, but none of it worked for me. I just
> need to see the whole thing.
>
> This is all i want to do.
> DB = SQL northwind
> Table = Customer
> Column = Contact Name
> One Textbox = textbox1 with default value of "c"
>
> I just want to see how you can pass a variable to the Select using Like
> that contains the value in the textbox1.text. The result will show on a
> simple GridView. I know I basically have to do it with parameters and
> I've
> read a lot and tried a lot and can not get it to work. This is the Select
> from VS2005. Can someone tell me if this is correct? My peramter name is
> @test. The SQLDataSource is fine.
>
> SelectCommand="SELECT [ContactName] FROM [Customers] WHERE ([ContactName]
> LIKE '%' + @test + '%')"
>
> Please please please create this simple aspx and paste the whole source
> code
> so I can see how it's done.
>
> Thanks in advance.
>
> Phil
>
>
>
>
>
>
>



Phillip Vong

2006-05-17, 7:05 pm

oops. That last post was for something else.

"Phillip Vong" <phillip_vong*at*yahoo*dot*com> wrote in message
news:%23mAthTReGHA.1276@TK2MSFTNGP03.phx.gbl...
> Got it. I put this in the OnClick event.
>
> FormView1.FindControl("updatebutton").Visible = True
>
>
>
>
>
>
>
> "Phillip Vong" <phillip_vong*at*yahoo*dot*com> wrote in message
> news:%234CXAelWGHA.752@TK2MSFTNGP02.phx.gbl...
>
>



Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com