| | |
How Can I Use View Here
Please support our ASP.NET advertiser: $4.95 a Month - ASP.NET Web Hosting – Click Here!
![]() |
•
•
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 beginner bottomasp.net browser businesslogiclayer c# cac checkbox class commonfunctions compatible content contenttype countryselector courier dataaccesslayer database datagrid datagridview datagridviewcheckbox datalist deployment development dgv dropdownlist dropdownmenu dynamic dynamically edit embeddingactivexcontrol fileuploader fill findcontrol flash flv formatdecimal formview gridview gudi iframe iis javascript listbox menu microsoft mouse mssql multistepregistration nameisnotdeclared news opera panelmasterpagebuttoncontrols problem redirect registration relationaldatabases reportemail rotatepage schoolproject security serializesmo.table sessionvariables silverlight smartcard smoobjects software sql sql-server sqlserver2005 ssl textbox tracking treeview unauthorized validatedate validation vb.net video videos virtualdirectory vista visual-studio visualstudio web webapplications webarchitecture webdevelopemnt webdevelopment webprogramming webservice youareanotmemberofthedebuggerusers





