Thursday, March 29, 2012
How Query Analyzer works in Text Mode option ?
I want to write a application works in same manner as SQL Query Analyzer
works in Text mode option. I studied the behavior of query analyzer and find
out that in text mode option query analyzer does not wait for the query to
get finished, for displaying the result.
It diplays the result in Text form as and when it gets the result. It works
in some different manner than Query Analyzer working in GRID option.
I also want to write a application which does not wait for all the results
of the query, just give me the records which are available right now and
then give the remaining ones also in similar chunks.
Query Analyzer must be using some API calls through which this is possible.
Can any one help me in figure out what APIs are used by query analyzer in
text mode option.
Any help is appreciated.
Thanks
PushkarTo the best of my knowledge, you cannot use ADO or ADO.NET for this. QA uses
ODBC, and I have a
feeling that it is possible using OLEDB as well. So pick up a programmers ma
nual for one of those
APIs and check for asynchronous execution. But you should carefully consider
the extra work to use
these low level APIs compared to the productivity of a higher level API.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
Blog: http://solidqualitylearning.com/blogs/tibor/
"Pushkar" <pushkartiwari@.gmail.com> wrote in message news:eSsFbyTMGHA.2704@.TK2MSFTNGP15.phx
.gbl...
> Hi,
> I want to write a application works in same manner as SQL Query Analyzer w
orks in Text mode
> option. I studied the behavior of query analyzer and find out that in text
mode option query
> analyzer does not wait for the query to get finished, for displaying the r
esult.
> It diplays the result in Text form as and when it gets the result. It work
s in some different
> manner than Query Analyzer working in GRID option.
> I also want to write a application which does not wait for all the results
of the query, just give
> me the records which are available right now and then give the remaining o
nes also in similar
> chunks.
> Query Analyzer must be using some API calls through which this is possible
.
> Can any one help me in figure out what APIs are used by query analyzer in
text mode option.
> Any help is appreciated.
> Thanks
> Pushkar
>
>|||Pushkar wrote:
> Hi,
> I want to write a application works in same manner as SQL Query Analyzer
> works in Text mode option. I studied the behavior of query analyzer and fi
nd
> out that in text mode option query analyzer does not wait for the query to
> get finished, for displaying the result.
> It diplays the result in Text form as and when it gets the result. It work
s
> in some different manner than Query Analyzer working in GRID option.
> I also want to write a application which does not wait for all the results
> of the query, just give me the records which are available right now and
> then give the remaining ones also in similar chunks.
> Query Analyzer must be using some API calls through which this is possible
.
> Can any one help me in figure out what APIs are used by query analyzer in
> text mode option.
> Any help is appreciated.
> Thanks
> Pushkar
It may help you to read:
http://www.aspfaq.com/show.asp?id=2120
David Portas, SQL Server MVP
Whenever possible please post enough code to reproduce your problem.
Including CREATE TABLE and INSERT statements usually helps.
State what version of SQL Server you are using and specify the content
of any error messages.
SQL Server Books Online:
http://msdn2.microsoft.com/library/ms130214(en-US,SQL.90).aspx
--|||Good thinking, David. :-)
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
Blog: http://solidqualitylearning.com/blogs/tibor/
"David Portas" <REMOVE_BEFORE_REPLYING_dportas@.acm.org> wrote in message
news:1139910046.905427.137570@.g43g2000cwa.googlegroups.com...
> Pushkar wrote:
> It may help you to read:
> http://www.aspfaq.com/show.asp?id=2120
> --
> David Portas, SQL Server MVP
> Whenever possible please post enough code to reproduce your problem.
> Including CREATE TABLE and INSERT statements usually helps.
> State what version of SQL Server you are using and specify the content
> of any error messages.
> SQL Server Books Online:
> http://msdn2.microsoft.com/library/ms130214(en-US,SQL.90).aspx
> --
>
Friday, March 23, 2012
How many ways to connect to a database?
How many ways are there to connect to a database in ASP.NET? Could someone list them in a 1,2,3... manner.
For those who are going to ask why I want to know this and why I don't do one way, I'll explain after I get the answer.
http://msdn2.microsoft.com/en-us/library/ms178371.aspx
HTH,
Suprotim Agarwal
|||Thanks for reply.
I tried to creat a sqldatasource according to that page so I modified config file and added this:
<connectionStrings>
<add name="linksConnectionString" connectionString=" Server=local;Database=mahmood_links;Integrated Security=SSPI;" providerName="System.Data.SqlClient"/>
</connectionStrings>
and put this line on my aspx page:
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:linksConnectionString %>"
SelectCommand="SELECT * FROM [link]"></asp:SqlDataSource>
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" DataKeyNames="ID"
DataSourceID="SqlDataSource1">
<Columns>
<asp:BoundField DataField="ID" HeaderText="ID" InsertVisible="False" ReadOnly="True"
SortExpression="ID" />
<asp:BoundField DataField="URL" HeaderText="URL" SortExpression="URL" />
<asp:BoundField DataField="TITLE" HeaderText="TITLE" SortExpression="TITLE" />
</Columns>
</asp:GridView>
But when I ran the file got lots of line of error, these are the first lines of error:
An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)
what could be the problem then?
|||Dear mahmood,
Do you have Sql Server 2005 sp2 installed on your computer. Kindly install that and see if that solves your problem.
After having done that, if the problem still persists, you can checkthis link.
HTH,
Suprotim Agarwal
|||Thanks for replies.
I found out that I needed this connectionstring for the server
Server=localhost;uid=myId;pwd=myPass;database=myDataBase
sql