| | |
How Can I Use View Here
Please support our ASP.NET advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Dec 2008
Posts: 11
Reputation:
Solved Threads: 0
Hi Frends,
Can I use View Insted of query in my code.
If yes Then plz tell me how can.
Thanks
Can I use View Insted of query in my code.
If yes Then plz tell me how can.
asp.net Syntax (Toggle Plain Text)
Protected Sub checkavailabilityusername(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.FormViewInsertEventArgs) Handles usersformview.ItemInserting Dim name As TextBox Dim username As String Dim Query As String Dim dr As SqlDataReader Dim db As DBConnection db = DBConnection.getConnection() name = usersformview.FindControl("username") username = name.Text Query = "SELECT [username] FROM [customer] where [username] = '" & username & "' " dr = db.executeQuery(Query) If dr.Read = True Then e.Cancel = True errmsg.Text = "<h5 style='color:#270000;'> The User Name you have entered is already exists.Please enter another User Name.</h5>" 'Response.Write("<h4 color=red> The Country name you have entered is already exists.Please enter another the country name.</h4>") End If dr.Close() End Sub
Thanks
Last edited by peter_budo; Jan 11th, 2009 at 2:41 pm. Reason: Keep It Organized - For easy readability, always wrap programming code within posts in [code] (code blocks) and [icode] (inline code) tags.
•
•
Join Date: Dec 2008
Posts: 104
Reputation:
Solved Threads: 18
A view is, in essence, a virtual table which is based on SQL SELECT query. It does not physically exist. A view is an object that can derive data from one or more tables. For Eg Suppose there is a Users Table named customer which has some 100 columns and your wish to create a view with just the userName column
Now rather than using the customer table you can use the view 'view_UserNames' in you code.
sql Syntax (Toggle Plain Text)
CREATE VIEW view_UserNames AS SELECT UserName FROM customer
Now rather than using the customer table you can use the view 'view_UserNames' in you code.
Last edited by peter_budo; Jan 11th, 2009 at 2:42 pm. Reason: Keep It Organized - For easy readability, always wrap programming code within posts in [code] (code blocks) and [icode] (inline code) tags.
•
•
Join Date: Dec 2008
Posts: 11
Reputation:
Solved Threads: 0
•
•
•
•
A view is, in essence, a virtual table which is based on SQL SELECT query. It does not physically exist. A view is an object that can derive data from one or more tables. For Eg Suppose there is a Users Table named customer which has some 100 columns and your wish to create a view with just the userName column
CREATE VIEW view_UserNames AS
SELECT UserName
FROM customer
Now rather than using the customer table you can use the view 'view_UserNames' in you code.
Ok Thanq
![]() |
Similar Threads
- Windows 2000 - Windows Explorer folder view is gone (Windows NT / 2000 / XP)
- why cant i just view (Windows NT / 2000 / XP)
- Can't view source codes (Web Browsers)
- View Source in IE6 (Web Browsers)
Other Threads in the ASP.NET Forum
- Previous Thread: Screen Capturing in a Web Application
- Next Thread: Using login form control, how to redirect users to different pages?
| Thread Tools | Search this Thread |
.net 2.0 3.5 activexcontrol advice ajax alltypeofvideos asp asp.net bc30451 bottomasp.net browser businesslogiclayer button c# c#gridviewcolumn checkbox class click commonfunctions compatible confirmationcodegeneration content contenttype control countryselector courier css database datagrid datagridview datagridviewcheckbox datalist deadlock deployment development dgv dropdownlist dropdownmenu dynamic edit embeddingactivexcontrol expose findcontrol flash flv formatdecimal forms formview gridview homeedition iframe iis javascript jquery list login menu microsoft mono mssql multistepregistration nameisnotdeclared numerical objects order panelmasterpagebuttoncontrols problem ratings rotatepage save schoolproject search security serializesmo.table silverlight smartcard sql sqlserver2005 ssl suse textbox tracking unauthorized validation vb.net video virtualdirectory vista visual-studio visualstudio vs2008 web webarchitecture webdevelopemnt webdevelopment webservice wizard xml youareanotmemberofthedebuggerusers





