Sunday, March 25, 2012
Attach a Database from multiple computers? (SQL Server Express 2005)
attach to a single database file, hosted on a networked drive? Eg
does one instance of Express lock the database when it is attached?
I am replacing Access db calls in a program and it access a db on a
shared location. I would rather not try to get the client to set up a
network enabled Express server!
"David" <dm_fw@.sbcglobal.net> wrote in message
news:6uo2i2528b3ju7vp1bqbm7hi8d8ft3fe7r@.4ax.com...
> Can multiple computers,running SQL Server Express 2005, simultaneously
> attach to a single database file, hosted on a networked drive?
No. A SQL Server instance requires exclusive access to its database files.
And moreover attaching database files on a network is not supported.
>Eg
> does one instance of Express lock the database when it is attached?
> I am replacing Access db calls in a program and it access a db on a
> shared location. I would rather not try to get the client to set up a
> network enabled Express server!
Well, that's just the way SQL Server works.
David
|||"David" <dm_fw@.sbcglobal.net> wrote in message
news:6uo2i2528b3ju7vp1bqbm7hi8d8ft3fe7r@.4ax.com...
> I am replacing Access db calls in a program and it access a db on a
> shared location. I would rather not try to get the client to set up a
> network enabled Express server!
Then you are using the wrong product. What on earth would be the point of
replacing Jet with just another file sharing program?
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
Attach a Database from multiple computers? (SQL Server Express 2005)
attach to a single database file, hosted on a networked drive? Eg
does one instance of Express lock the database when it is attached?
I am replacing Access db calls in a program and it access a db on a
shared location. I would rather not try to get the client to set up a
network enabled Express server!"David" <dm_fw@.sbcglobal.net> wrote in message
news:6uo2i2528b3ju7vp1bqbm7hi8d8ft3fe7r@.4ax.com...
> Can multiple computers,running SQL Server Express 2005, simultaneously
> attach to a single database file, hosted on a networked drive?
No. A SQL Server instance requires exclusive access to its database files.
And moreover attaching database files on a network is not supported.
>Eg
> does one instance of Express lock the database when it is attached?
> I am replacing Access db calls in a program and it access a db on a
> shared location. I would rather not try to get the client to set up a
> network enabled Express server!
Well, that's just the way SQL Server works.
David|||"David" <dm_fw@.sbcglobal.net> wrote in message
news:6uo2i2528b3ju7vp1bqbm7hi8d8ft3fe7r@.4ax.com...
> I am replacing Access db calls in a program and it access a db on a
> shared location. I would rather not try to get the client to set up a
> network enabled Express server!
Then you are using the wrong product. What on earth would be the point of
replacing Jet with just another file sharing program?
--
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
--
Attach a Database from multiple computers? (SQL Server Express 2005)
attach to a single database file, hosted on a networked drive? Eg
does one instance of Express lock the database when it is attached?
I am replacing Access db calls in a program and it access a db on a
shared location. I would rather not try to get the client to set up a
network enabled Express server!"David" <dm_fw@.sbcglobal.net> wrote in message
news:6uo2i2528b3ju7vp1bqbm7hi8d8ft3fe7r@.
4ax.com...
> Can multiple computers,running SQL Server Express 2005, simultaneously
> attach to a single database file, hosted on a networked drive?
No. A SQL Server instance requires exclusive access to its database files.
And moreover attaching database files on a network is not supported.
>Eg
> does one instance of Express lock the database when it is attached?
> I am replacing Access db calls in a program and it access a db on a
> shared location. I would rather not try to get the client to set up a
> network enabled Express server!
Well, that's just the way SQL Server works.
David|||"David" <dm_fw@.sbcglobal.net> wrote in message
news:6uo2i2528b3ju7vp1bqbm7hi8d8ft3fe7r@.
4ax.com...
> I am replacing Access db calls in a program and it access a db on a
> shared location. I would rather not try to get the client to set up a
> network enabled Express server!
Then you are using the wrong product. What on earth would be the point of
replacing Jet with just another file sharing program?
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
--
Tuesday, March 20, 2012
Association Rules Model for problem
What would be the right design approach for the following problem?
I have a single table called SelectionFactors, which has the following columns and sample data:
The problem is to allow a descriptive analysis of the data to find patterns in the users selections. For instance,
if Languages->English is selected, what are the counts of projects for other Factor->Factor Value combinations?
Countries->USA = 2, Countries->Canada=1, Company Type->Consulting=1 and so on.
Since all the data is in this single table, are both the case and nested tables the same? What are the keys and inputs? I only need a descriptive analysis (no prediction) and ALL possible combinations MUST be part of the results; how should the model be designed?
Thank you,
Anna.
This is a good problem. What you want to do is to create a model with three nested tables all marked predict and input. Event though you want descriptive analysis, you need to mark them "predict" such that rules will be formed (only items marked predict will show on the right hand side of rules).
The way you will create such a model is to use the "Named Query" feature of the data source view(DSV). You can right-click on the DSV and select "New Named Query" to create these.
The named queries you will want to create are these:
Projects: SELECT DISTINCT ProjectID FROM SelectionFactors
Companies: SELECT ProjectID, FactorValue FROM SelectionFactors WHERE Factor='Companies'
Languages: SELECT ProjectID, FactorValue FROM SelectionFactors WHERE Factor='Languages'
Company Type: SELECT ProjectID, FactorValue FROM SelectionFactors WHERE Factor='Company Type'
You will then need to relate the ProjectID in each of the transaction named queries (Companies, etc) to the ProjectID in the Projects named query. The system will prompt you to set ProjectID as the key of the Projects named query . At this point, the named queries are equivalent to tables as far as Analysis Services is concerned.
When you create the model, you will make the Projects table the case table and the other tables nested tables. ProjectID will be the key of the Projects table and FactorValue will be the key of the other tables. Make sure to mark FactorValue as Key, Input, and Output.
When you process your model you will see rules relating projects, companies, and company types (both between factos and in the same factor).
Note that you may need to adjust the MINIMUM_SUPPORT and MINIMUM_PROBABILITY parameters to get the results you need (in fact, it's recommended)
HTH
-Jamie
|||Thanks for your response.
However, I should have mentioned that there is an open-ended number of "Factors". New factors are added often and the number of factors is nearly 100.
The type of questions I am trying to answer using this model is:
"Among projects that have Languages-> English, how many (distinct projects) have Company Type->Consulting, Countries->USA" and so on.
Ideally, I would like to provide this analysis in a free, OLAP environment where the user can select one factor-> factor value combination and then see all the other related combinations.
I currently have a Cube with SelectionFactors serving as both the Fact and the dimension table with a single measure - DISTINCT COUNT of projectIDs.
Thanks once again.
|||
Given the information in my previous post, what are my design options?
Thanks.
|||
My question for you, then, is if you have a cube for this, what are you not getting that you need?
If the factor/factorvalue can be viewed as a complete unit, and you don't need to provide analysis between factors - e.g. given Language X, which Countries and Company Types are prevalent, you could create a calculated column in the DSV that combines the factor and factor value.
|||Perhaps you can help me understand why I am unable to get the expected results. I am fairly new to OLAP and Data Mining and would appreciate any pointers and guidance.
The full picture of my problem is:
Dimension Project Profile - Project ID, (Other Project related attributes)
Dimension Selection Factors - Factor, Factor Value
Fact Selection Factors - Project ID, Factor, Factor Value
Project Cube Measure - DISTINCT COUNT of Project IDs
My understanding is that this is a problem of intersection of factors, which I cannot achieve with a single dimension. In fact there is this other thread http://forums.microsoft.com/msdn/showpost.aspx?postid=856304&siteid=1 that seems to come very close to my problem.
In my case, the following MDX returns the projects that have the intersection of specific factor values.
SELECT {[Measures].[Project Count]} ON COLUMNS,
INTERSECT
(
NONEMPTY
(
[Project Profile].[Project ID].Children,
(
[Measures].[Project Count],
[Selection Factor].[Selection Factors].[Factor].&[Annual Revenue].&[$500 million - $3 billion in revenues]
)
),
NONEMPTY
(
[Project Profile].[Project ID].Children,
(
[Measures].[Selection Project Count],
[Selection Factor].[Selection Factors].[Factor].&[Concurrent Users].&[1,000–10,000 users]
)
)
)
ON ROWS
FROM PROJECTCUBE
The questions are:
1. How do I get all the other Factor->Factor Values that are part of the selection factors for the projects returned by this MDX. This, if I understand correctly, is Basket analysis.
and
2. Is there a generic way to perform this analysis through cube design rather than writing MDX for each case?
Thanks once more.|||The following MDX gives me the contents of the "baskets" of projects that have the selected items. However, the counts of the projects is not restricted to the subset retrieved through the Intersect. Is there a way to get the counts to only be within the subset returned by the Intersect?
With this MDX, I can get very close to what I need. The only thing I am missing is to get the counts (perhaps through a calculated measure). Help on this will be much appreciated!
__
SELECT [Measures].[Project Count] ON COLUMNS,
NONEMPTY
(
([Selection Factor].[Factor].Children, [Selection Factor].[Factor Value].Children),
INTERSECT
(
NONEMPTY
(
[Project Profile].[Project ID].Children,
(
[Measures].[Selection Project Count],
[Selection Factor].[Selection Factors].[Factor].&[Annual Revenue].&[$500 million - $3 billion in revenues]
)
),
NONEMPTY
(
[Project Profile].[Project ID].Children,
(
[Measures].[Selection Project Count],
[Selection Factor].[Selection Factors].[Factor].&[Concurrent Users].&[1,000–10,000 users]
)
)
)
)
ON ROWS
FROM PROJECTCUBE
|||In order to obtain counts restricted to the subset returned by the Intersect, this MDX takes the constraint out of the ROWS into the WHERE clause.
I would still like to know how to design an Association rules model that can "automate" the generation of results by case. Hopefully, the MDX can point directly to the expected results.
SELECT [Measures].[Project Count] ON COLUMNS,
NONEMPTYCROSSJOIN([Selection Factor].[Factor].Children, [Selection Factor].[Factor Value].Children)
ON ROWS
FROM PROJECTCUBE
WHERE
NONEMPTY(
INTERSECT
(
NONEMPTY
(
[Project Profile].[Project ID].Children,
(
[Measures].[Project Count],
[Selection Factor].[Selection Factors].[Factor].&[Annual Revenue].&[$500 million - $3 billion in revenues]
)
),
NONEMPTY
(
[Project Profile].[Project ID].Children,
(
[Measures].[Project Count],
[Selection Factor].[Selection Factors].[Factor].&[Concurrent Users].&[1,000–10,000 users]
)
)
)
)
sqlMonday, March 19, 2012
Assistance with Stored Procedure
for a user to be able to input multiple values into a single field
with some sort of delimiter (such as a comma). I want to pass this
field into a Stored Procedure and have the stored procedure use the
data to generate the resutls.
Example:
Web page would ask for ID number into a field called IDNum. User
could input one or many ID numbers separated by a comma or some other
delemiter - could even be just a space (113, 114, 145).
SQL statement in Stored Procedure is something like this:
Select * from tblEmployess where IDNumber = @.IDNum
I need the SQL statement to somehow use an "or" or a "loop" to get all
of the numbers passed and use the delimiter to distinguish when the
"loop" stops.
I obtained a module from a friend that allows me to do this in access,
but have recently converted everything to SQL server and web
interface. Now, everyone in the office expects to be able to
accomplish the same results via the web.
Any help is appreciated. If you need any additional information to
provide me some assistance, please email me at
tod.thames@.nc.ngb.army.mil.
Thanks in advance.
TodTake a look at http://www.algonet.se/~sommar/arrays-in-sql.html.
--
Hope this helps.
Dan Guzman
SQL Server MVP
--------
SQL FAQ links (courtesy Neil Pike):
http://www.ntfaq.com/Articles/Index...epartmentID=800
http://www.sqlserverfaq.com
http://www.mssqlserver.com/faq
--------
"Tod Thames" <tod.thames@.nc.ngb.army.mil> wrote in message
news:5ed144f0.0310050454.369f4994@.posting.google.c om...
> I am running SQL Server 7.0 and using a web interface. I would like
> for a user to be able to input multiple values into a single field
> with some sort of delimiter (such as a comma). I want to pass this
> field into a Stored Procedure and have the stored procedure use the
> data to generate the resutls.
> Example:
> Web page would ask for ID number into a field called IDNum. User
> could input one or many ID numbers separated by a comma or some other
> delemiter - could even be just a space (113, 114, 145).
> SQL statement in Stored Procedure is something like this:
> Select * from tblEmployess where IDNumber = @.IDNum
>
> I need the SQL statement to somehow use an "or" or a "loop" to get all
> of the numbers passed and use the delimiter to distinguish when the
> "loop" stops.
> I obtained a module from a friend that allows me to do this in access,
> but have recently converted everything to SQL server and web
> interface. Now, everyone in the office expects to be able to
> accomplish the same results via the web.
> Any help is appreciated. If you need any additional information to
> provide me some assistance, please email me at
> tod.thames@.nc.ngb.army.mil.
> Thanks in advance.
> Tod|||Everytime I try to get to the website you refrenced, I get TCP_ERROR.
Some sort of communication problem. Is there any other sites that have
the same sort of information?
Thanks for the response,
Tod
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!|||I don't know if the content is mirrored elsewhere. The author, Erland
Sommarskog, frequents this newsgroup so maybe he'll jump in.
BTW, I don't have any problems accessing the site.
--
Hope this helps.
Dan Guzman
SQL Server MVP
"Tod Thames" <tod.thames@.nc.ngb.army.mil> wrote in message
news:3f803253$0$195$75868355@.news.frii.net...
> Everytime I try to get to the website you refrenced, I get TCP_ERROR.
> Some sort of communication problem. Is there any other sites that
have
> the same sort of information?
> Thanks for the response,
> Tod
>
> *** Sent via Developersdex http://www.developersdex.com ***
> Don't just participate in USENET...get rewarded for it!|||[posted and mailed]
Tod Thames (tod.thames@.nc.ngb.army.mil) writes:
> Everytime I try to get to the website you refrenced, I get TCP_ERROR.
> Some sort of communication problem. Is there any other sites that have
> the same sort of information?
Too bad. If you have the complete error message, I'm interested. I'm
inclined to suspect that this might be some firewall problem at your
side, but I might get carried away of the .mil in your address.
Anyway, here is an excerpt of the part which is most relevant to
you. If you want to read the entire article, just drop me a line.
An Extravagant List-of-integers Procedure
The technique in the previous section can of course be applied to a list
of integers as well, so what comes here is not a true port of the
iter_intlist_to_table function, but a version that goes head over heels
to validate that the list items are valid numbers to avoid a conversion
error. And to be extra ambitious, the procedure permits for signed
numbers such as +98 or -83. If a list item is not a legal number, the
procedure produces a warning. The procedure fills in a temp table that
has a listpos column; this column will show a gap if there is an illegal
item in the input.
CREATE PROCEDURE intlist_to_table_sp @.list ntext AS
DECLARE @.pos int,
@.textpos int,
@.listpos int,
@.chunklen smallint,
@.str nvarchar(4000),
@.tmpstr nvarchar(4000),
@.leftover nvarchar(4000)
SET NOCOUNT ON
SELECT @.textpos = 1, @.listpos = 1, @.leftover = ''
WHILE @.textpos <= datalength(@.list) / 2
BEGIN
SELECT @.chunklen = 4000 - datalength(@.leftover) / 2
SELECT @.tmpstr = ltrim(@.leftover + substring(@.list, @.textpos, @.chunklen))
SELECT @.textpos = @.textpos + @.chunklen
SELECT @.pos = charindex(' ', @.tmpstr)
WHILE @.pos > 0
BEGIN
SELECT @.str = rtrim(ltrim(substring(@.tmpstr, 1, @.pos - 1)))
EXEC insert_str_to_number @.str, @.listpos
SELECT @.listpos = @.listpos + 1
SELECT @.tmpstr = ltrim(substring(@.tmpstr, @.pos + 1, len(@.tmpstr)))
SELECT @.pos = charindex(' ', @.tmpstr)
END
SELECT @.leftover = @.tmpstr
END
IF ltrim(rtrim(@.leftover)) <> ''
EXEC insert_str_to_number @.leftover, @.listpos
go
-- This is a sub-procedure to intlist_to_table_sp
CREATE PROCEDURE insert_str_to_number @.str nvarchar(200),
@.listpos int AS
DECLARE @.number int,
@.orgstr nvarchar(200),
@.sign smallint,
@.decimal decimal(10, 0)
SELECT @.orgstr = @.str
IF substring(@.str, 1, 1) IN ('-', '+')
BEGIN
SELECT @.sign = CASE substring(@.str, 1, 1)
WHEN '-' THEN -1
WHEN '+' THEN 1
END
SELECT @.str = substring(@.str, 2, len(@.str))
END
ELSE
SELECT @.sign = 1
IF @.str LIKE '%[0-9]%' AND @.str NOT LIKE '%[^0-9]%'
BEGIN
IF len(@.str) <= 9
SELECT @.number = convert(int, @.str)
ELSE IF len(@.str) = 10
BEGIN
SELECT @.decimal = convert(decimal(10, 0), @.str)
IF @.decimal <= convert(int, 0x7FFFFFFF)
SELECT @.number = @.decimal
END
END
IF @.number IS NOT NULL
INSERT #numbers (listpos, number) VALUES (@.listpos, @.sign * @.number)
ELSE
RAISERROR('Warning: at position %d, the string "%s" is not an legal integer',
10, -1, @.listpos, @.orgstr)
go
Here is how you would use it:
CREATE PROCEDURE get_product_names_iterproc @.ids varchar(50) AS
CREATE TABLE #numbers (listpos int NOT NULL,
number int NOT NULL)
EXEC intlist_to_table_sp @.ids
SELECT P.ProductID, P.ProductName
FROM Northwind..Products P
JOIN #numbers n ON P.ProductID = n.number
go
EXEC get_product_names_iterproc '9 12 27 37'
The validation of the list item is in the sub-procedure
insert_str_to_number. For many purposes it would be sufficient to have
the test
@.str NOT LIKE '%[^0-9]%' AND len(@.str) BETWEEN 1 AND 9
which checks that @.str only contain digits and is at most nine digits
long (that is, you disapprove ten-digit numbers as well as signed
numbers).
You might guess that there is a performance cost for this extravaganza,
and indeed the procedure needs about 50% more time than the corresponding
function. Still, for many situations, the execution time is acceptable.
One note about the warning produced with RAISERROR: with ADO, this
warning may be difficult or impossible to detect on client level. If you
change the severity from 10 to 11, it will be an error, and raise an
error in your client code.
--
Erland Sommarskog, SQL Server MVP, sommar@.algonet.se
Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techin.../2000/books.asp|||
Thanks for the response - it's a little above my abilities, but I plan
on studying it and trying to make it work for me project.
Tod
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!|||See if the following link helps..
http://tinyurl.com/6iil
--
-- Anith|||Tod,
Try this:
create procedure ListEmployees
@.IDNum char(1024)
as begin
set @.IDNum = ' ' + replace(@.IDNum, ',', ' ') + ' '
select *
from tblEmployess
where @.IDNum like ('% ' + ltrim(str(IDNumber)) + ' %')
end
Shervin
"Tod Thames" <tod.thames@.nc.ngb.army.mil> wrote in message
news:5ed144f0.0310050454.369f4994@.posting.google.c om...
> I am running SQL Server 7.0 and using a web interface. I would like
> for a user to be able to input multiple values into a single field
> with some sort of delimiter (such as a comma). I want to pass this
> field into a Stored Procedure and have the stored procedure use the
> data to generate the resutls.
> Example:
> Web page would ask for ID number into a field called IDNum. User
> could input one or many ID numbers separated by a comma or some other
> delemiter - could even be just a space (113, 114, 145).
> SQL statement in Stored Procedure is something like this:
> Select * from tblEmployess where IDNumber = @.IDNum
>
> I need the SQL statement to somehow use an "or" or a "loop" to get all
> of the numbers passed and use the delimiter to distinguish when the
> "loop" stops.
> I obtained a module from a friend that allows me to do this in access,
> but have recently converted everything to SQL server and web
> interface. Now, everyone in the office expects to be able to
> accomplish the same results via the web.
> Any help is appreciated. If you need any additional information to
> provide me some assistance, please email me at
> tod.thames@.nc.ngb.army.mil.
> Thanks in advance.
> Tod
assistance with sql query
SELECT DISTINCT servername,
(SELECT COUNT(*)
FROM pingtable
WHERE (status = '0')) AS Uptime,
(SELECT COUNT(*)
FROM pingtable
WHERE (status <> '0')) AS DownTime
FROM pingtable
but this gives me the
server1 7 2
server1 7 2
...
Table layout and data:
servername status
server1 up
server1 up
server1 down
server2 up
server2 up
server2 up
server3 down
server3 up
server3 up
the output I would like to have is
Server UpCount DownCount
Server1 2 1
Server2 3 0
Server3 2 1Lookup crosstab queries in books online. Near the bottom is some sample code you can modify for your needs.
You'll end up with something like this:
Select Server,
sum(Case Status when 0 then 1 else 0) Uptime,
sum(Case Status when <> 0 then 1 else 0) Downtime
From PingTable
Group by Server
I'm not sitting at a server console now, so I had to draft it from memory and it probably has syntax errors in it, but you should be able to get the idea.
blindman|||Thanks so much for holding my hand there,
Here is the final query that worked perfectly
Select Server,
sum(Case Status when 0 then 1 else 0 end) as Uptime,
sum(Case Status when 0 then 0 else 1 end) as Downtime
From eladmin.PingstatsNT
Group by Server
Originally posted by blindman
Lookup crosstab queries in books online. Near the bottom is some sample code you can modify for your needs.
You'll end up with something like this:
Select Server,
sum(Case Status when 0 then 1 else 0) Uptime,
sum(Case Status when <> 0 then 1 else 0) Downtime
From PingTable
Group by Server
I'm not sitting at a server console now, so I had to draft it from memory and it probably has syntax errors in it, but you should be able to get the idea.
blindman|||FYI, if your Status field always holds zeros or ones, set it's data type to bit to ensure that your code will always work correctly.
blindman
Sunday, February 12, 2012
asp.net configuration tool
I deployed a web site, and converted SQL Server Express to a single SQL Server 2005 database. I created all of the tables required for memberships and roles with aspnet_regsql.exe.
Real simple question - how can I populate the membership and role tables out on the server? When I attach VWD to it, the ASP.NET Configuration tool is gone. How do you maintain memberships and roles without the tool?
Thanks for any help you will share :)
It's been a long journey but I am finally here!
Hi CK,
I'm going to punt on this one.
The ASP.net forums is a better place to ask questions about ASP.net and Visual Web Developer. You can find all the forums at http://forums.asp.net/ and the forum that is specifically about SQL Express in VWD at http://forums.asp.net/54/ShowForum.aspx.
I can't redirect outside of MSDN, so you'll need to repost the question in the new forum.
Mike
|||Hi mike,
You helped me SO MUCH already on other questions -- xoxo
I'll buy you a beer if you are in redmond and when I get this one figured out.
Are you in?
ck
|||It's beer time Mike.
VWD asp.net configuration tool successfully allowed me to update roles and memberships.
My web site is up and running.
For future reference, this article was of help: 4guysfromrolla.com article 040506-1
thanks again for helping me - let's go!
Thursday, February 9, 2012
asp.net 2.0 data base connection problem.....
we have Sql Server 2000 and Sql Server 2005 IN A SINGLE MACHINE.
when connecting with data base Sql Server 2000 with asp.net 2.0 application ,an error occur
"Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding."
can anyone suggest any idea to solve this problem...
thanking u.
Hi niladrisekharghosh,
Execute your query in your in Query Analyzer to see how long it takes.The default sql connection timeout is 30s so if it takes more than 30s to finish your query you have reset the timeout(or you have to optimize your query):
myCommand.CommandTimeout = 180 (more than 30s)
Hope it helps.
|||You can increate the query timeout, on the connection there is a property called Timeout =