How to develop a Query Analyzer - asp.net

I want to develop the application in which user write query into the text box when it click on the submit button it displays the results in the Grid just just in the Sql Server query analyzer tool i used VS 2008 and application develop in Asp.Net using C#.
Thanks

It depends on how advanced you want to have it. Most scenarios suffice with a single textbox in which the sql statement can be written, a button to submit it and a GridView control with AutoGenerateColumns="true" (the default) to display the requested data. In the codebehind you simply take the string from the textbox, use it as inline sql statement and use simple ADO.NET to connect with the database and bind the result to the GridView.

Related

should we always use sqldatasource while we are using Gridview in asp.net?

should we always use sqldatasource while we are using Gridview in asp.net?
I am a beginner to asp.net. We can handle gridview using sqldatasource and ado.net codes with databind.Using ado.net codes makes it complex to sort,insert,edit and update the gridview,so should we always work with sqldatasource?
It is not complex to sort, insert, edit or whatever you want while using ADO.NET. Actually it gives you more flexibility when you are used to it. SQLDataSource is also a good option. But which one you need to use completely depends on the situation. Some people suggests that while using SQLDatasource, you will find the datasource name in the rendered HTML from clientside which can be reverse engineered to find useful data about your SQL server to some extend.

How do I make a shoppingcart in asp.net when I have loaded some items in a gridview and want to add the selected one to my shoppingcart?

I have tried to make the selectbutton an templatefield and insert the selected item in a accesdatabase via a SQL insert commant but it didn't work.
I am sorry if this is bad english.
Regards
Pieter
You'd better do this indirectly throught tha asp.net server side. If you dont know how to handle it, you should put server side button (from tool box) and after that double click on the button than you pass into the server side code to handle the click event. In this method you can do more powerful things include update the database via Ado.Net.

Automatically create data entry form based on a database table in ASP.NET

Is there some add-in, control or something else for Visual Studio 2008 using which one can automatically generate a webform mapped to fields of SQL Server database table. For instance, based on a user details table, a webform should be automatically generated having labels and textboxes and submit button to enter data into that table.
I tried searching the internet and mostly I found solutions for CRUD, which I don't want.
So please help.
Cheers.

ASP.NET - Use a checkbox to change the results of a SqlDataSource

I'm using Visual Web Developer 2010 Express. This is my first attempt at creating a .NET page. I have a Gridview on a page that displays the results of a GridQuery. This works. I have a checkbox control (cb_Filter) on the same page that if checked, should add to the where clause of the GridQuery, (where Column5 IS NULL). How do I check the state of the check box so it will run the query with or without the "filter".
really depends on your data access, if you have made a datasource on page, then you'll have two and the code will change which data source you have. if it is using the old ado.net then you will have two commands that run in seperate methods that get the sql query, and a similar thing will work for linq. Let me know how you bind to the grid and i will give you an example.
If you want the grid results to change dynamically, autopostback should be True for the checkbox. This will cause the page to reload when the value changes. Then, in your page load routine you do something like this:
If cb_filter.Checked Then
'set the checked datasource or SQL string here
Else
'set the unchecked datasource or SQL string here
End If

listview of ASP.NET(web application)

i have placed four textbox inside the listview of web application. if i enter data in first textbox, its corresponding record should be fetched from oracle database and fetched record should be placed in 2,3,4 textbox.
****TextBox.TextChanged Event
How to: Respond to Changes in a TextBox Web Server Control
Edit:
From your edit it would be better to use AJAX.
You can fetch data from oracle database from C# using the AJAX call and return the result to the response and display the data.
If you're using webforms you could use a WebMethod to invoke the query from javascript, you can see an example here.
You could also just add a control that invokes a function server side and use the FindControl method of the ListView to obtain the value of your textbox. Also if you want the function/method to be called when the user stops typing you could use a jQuery plugin called typewatch you can find it here. Also taking into account the WebMethod* attribute that I mentioned earlier in the answer.
Go through the article Complete ListView in ASP.NET 3.5. This article shows how to place textboxes inside listview and edit the data in listview.
For Oracle connection in ASP.NET this article Connecting to an Oracle Database Using ASP.NET—A Step-by-Step Tutorial will definitly helps you

Resources