| | |
How Can I Use View Here
Please support our ASP.NET advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
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?
Views: 333 | Replies: 2
| Thread Tools | Search this Thread |
Tag cloud for ASP.NET
.net 2.0 ajax alltypeofvideos anathor appliances application asp asp.net beginner box browser button c# cac checkbox commonfunctions complex connection control dataaccesslayer database datagridview datalist deployment development dgv dialog dropdownlist dynamic dynamically edit editing embeddingactivexcontrol feedback fileuploader fill findcontrol flash form formatdecimal formview gridview gudi iis image javascript languages list listbox login microsoft mobile mouse mssql news novell numerical opera panelmasterpagebuttoncontrols parent problem project radio redirect registration relationaldatabases reportemail response.redirect richtextbox rows schoolproject search security select services sessionvariables silverlight smoobjects software sql sql-server sqlserver2005 ssl theft tracking treeview validatedate validation vb.net videos vista visualstudio web webapplications webdevelopment webprogramming webservice xsl youareanotmemberofthedebuggerusers





