Showing posts with label connect. Show all posts
Showing posts with label connect. Show all posts

Thursday, March 29, 2012

How on EARTH do you connect to sql server using asp.net

im using the free asp.net web matrix.. and i have sql server installed on my local machine

i have looked all over the web to find how.. and cant find any.. does anyone actually have code to show how to do this?

please help someone> i have looked all over the web to find how..

really? I don't think you have, you know. for a start have you looked at the tutorials section of this site? or www.411asp.net? or www.4guysfromrolla.com? or my site? or in the .NET documentation?|||You may wish to look up System.Data.SqlClient

Wednesday, March 28, 2012

How not to display all databases under sql2k using sql management studio?

When you use sql 2005 management studio to connect to a sql 2005 server, you can deny view on any database and one user will not be able to see any database that he/she does not own.

However, what about if this person uses sql 2005 management studio to connect to a sql 2000 server. Since sql 2005 management studio does not call the store procedure sp_MSdbuseraccess, it will display all the database in the server.

It does not seem like I can use "deny view on any database to username" on a sql 2000 server.

Does anyone have any idea what I need to do in order to not show all the database when I use sql 2005 management studio to connect to a sql 2000 server box?

Thank you.EM will show the database as existing, but you can still deny access to the database and prevent people from opening it up or viewing the objects and data inside it.

Only admins should be using Enterprise Manager anyway...|||What I want to do is to deny any login id (who owns certain database) to not be able to see other database at all.

Just like sql 2005, you can run "deny view any database to userid"

However, doesn't seem like sql 2000 has this command.|||The databases are like houses. You can prevent people from going inside, but you can't prevent people from seeing them.

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.Smile

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

How many user current "connect" to a row in table.

Hi all...
Iam a newbie and i have one question want to ask experts ... .
I am current working on one App which have some user connect to database at the same time.
And i want to know: how many user connect or use (read , update) to one row in a table?
Could it be possible to know that? If you have one solution to solve this problem , please let me know :) ...
Could it be done by Software , T-SQL or anything ...., iam happy to know.
Thanks all.

Hello,

There's actually no straightforwarffd answer as this will depend upon the transaction isolation level which will in turn determine how many transactions may read a row as well as what state the data read will be in (dirty, comitted etc). Only one transaction can ever modify a row.

Have a look at http://www.microsoft.com/technet/prodtechnol/sql/2005/cncrrncy.mspx and http://msdn2.microsoft.com/en-US/library/ms173763.aspx as well as BOL for information.

Cheers,

Rob

|||Iam using SQL server 2000 and don't have intended to update to sql server 2005, so i can't use RLV.
I ask this question because i want to notify my clients when data was changed by users.
Is there any idea for me to solve this problem? if have , please show me more details
Thanks .:)|||Couldn't you try to use a trigger to make such a mecanism ?|||I think when a user changed data on the table and trigger on that table was fired then only that user was recieved alert from Server. Do you think so ?|||A trigger is fired on a statement level. When the trigger is fire you could write a message / row in a event table which is polled by the application. In another table you could save the information that the application of User A has received the notification but the application of user B did not. Althouh the trigger is fired once you could spread the *news* anout the changed data.

HTH, Jens K. Suessmeyer.

http://www.sqlserver2005.de

|||Thanks for your advise.
But i think traffic network is expensive resource so if my App keep polled the table which store info about what table has changed , it'll impact my performence which i want to avoid.
do you have anothet idea?
Thanks again.|||

Can you state the underlying purpose to what you are doing? It is not a natural thing to be interested in what row a user might be "connected" to. Now if you are talking about locking it for modification, that makes it a bit more clear, and you could use some form of lock to make that happen.

The thing is, SQL works in a very set oriented architecture, so you might touch a million rows when you think you end up only looking at one (it might require a scan of all values to find just one). SQL Server does nice things with locking, and there are techniques like optimistic locking that you can use to enhance concurrency, so if you could give a bit more information we might could suggest a better way.

|||

Louis Davidson wrote:

Can you state the underlying purpose to what you are doing? It is not a natural thing to be interested in what row a user might be "connected" to. Now if you are talking about locking it for modification, that makes it a bit more clear, and you could use some form of lock to make that happen.

The thing is, SQL works in a very set oriented architecture, so you might touch a million rows when you think you end up only looking at one (it might require a scan of all values to find just one). SQL Server does nice things with locking, and there are techniques like optimistic locking that you can use to enhance concurrency, so if you could give a bit more information we might could suggest a better way.

Thanks for your post :).

My purpose at

begin is Sql server or My App will notify my client when data was

changed for any client who current connect to that row.
For example:
-user A connect and load row R1 into dataset(vb.net).
-user B also connect to that table and load row R2
- R1 and R2 has some column which has the same data
==>

when user change data on some column and finished it,a litle later,

because user B did not know data was changed and continue changed that

data...so if i sum on total column(for example)then may be the value

was double and that is what i don't expect.

Sorry about my poor English, but if you understand what i mean , please give me your advise
Thanks.

Wednesday, March 21, 2012

How many networks does clustering need ?

I know there is a public network for all application communication and one
for hearbeat .
Are there any more ?
Does one connect the hearbeat network to like a local hub for the nodes or
to the same public network ( dont know if im stating this right) ? Whats
best practise to set up the private hearbeat ?But networks, I am assuming you mean network cards on the server. It is
recommend two; one for the Live check and one for public traffic on the node.
Thanks!
--
Mohit K. Gupta
B.Sc. CS, Minor Japanese
MCTS: SQL Server 2005
"Hassan" wrote:
> I know there is a public network for all application communication and one
> for hearbeat .
> Are there any more ?
> Does one connect the hearbeat network to like a local hub for the nodes or
> to the same public network ( dont know if im stating this right) ? Whats
> best practise to set up the private hearbeat ?
>
>
>

How many hosts can you connect to a SAN ?

Does anyone have some basics to how a SAN is laid out ? I was on the HDS
site and we are looking at the USP1100 and I came across terms like
Directors,etc, but wish there was some basics on SANs someplace..
Does anyone use USP1100 for SQL Servers and any pros and cons ?
SAN vendors usually have general documentation explaining their architecture
components. That would be the best place to start.
As to the pros and cons of a particular product/model, you may get a diverse
array of opinions. For instance, we use a certain vendor and certain models.
We spent a lot of time evaluating different vendor products, and developed
our opinions. We like what we have. But then, it's not rare to bump into
folks who have chosen the vendor/product we decided against, and they seem to
be happy as well. For such an important decision, I'd ask the vendor for
customer references, even though you know you would be given only satisfied
customers.
As to the question of 'how many hosts can you connect ...', the answer is
entirely dependent on the SAN configuration.
Linchi
"Hassan" wrote:

> Does anyone have some basics to how a SAN is laid out ? I was on the HDS
> site and we are looking at the USP1100 and I came across terms like
> Directors,etc, but wish there was some basics on SANs someplace..
> Does anyone use USP1100 for SQL Servers and any pros and cons ?
>
>
|||Mark,
Do you use the high end USP1100 ? If so, how many hosts can you connect to
it ? Do you ever have to take outages to all hosts to do some maintenance
work on the SAN or do you have all your hosts up and running all the time ?
"Mark Yudkin" <DoNotContactMe@.boingboing.org> wrote in message
news:OWRij$rQHHA.1200@.TK2MSFTNGP02.phx.gbl...
> We use HDS SAN with SQL Server.
> The best place for an introduction to SAN is a good book. Amazon gave me
> 705 hits, many at the "fundamentals" level. I suggest you start by buying
> one of them.
> "Hassan" <Hassan@.hotmail.com> wrote in message
> news:%23ufF6kpQHHA.996@.TK2MSFTNGP02.phx.gbl...
>

How many hosts can you connect to a SAN ?

Does anyone have some basics to how a SAN is laid out ? I was on the HDS
site and we are looking at the USP1100 and I came across terms like
Directors,etc, but wish there was some basics on SANs someplace..
Does anyone use USP1100 for SQL Servers and any pros and cons ?SAN vendors usually have general documentation explaining their architecture
components. That would be the best place to start.
As to the pros and cons of a particular product/model, you may get a diverse
array of opinions. For instance, we use a certain vendor and certain models.
We spent a lot of time evaluating different vendor products, and developed
our opinions. We like what we have. But then, it's not rare to bump into
folks who have chosen the vendor/product we decided against, and they seem to
be happy as well. For such an important decision, I'd ask the vendor for
customer references, even though you know you would be given only satisfied
customers.
As to the question of 'how many hosts can you connect ...', the answer is
entirely dependent on the SAN configuration.
Linchi
"Hassan" wrote:
> Does anyone have some basics to how a SAN is laid out ? I was on the HDS
> site and we are looking at the USP1100 and I came across terms like
> Directors,etc, but wish there was some basics on SANs someplace..
> Does anyone use USP1100 for SQL Servers and any pros and cons ?
>
>|||We use HDS SAN with SQL Server.
The best place for an introduction to SAN is a good book. Amazon gave me 705
hits, many at the "fundamentals" level. I suggest you start by buying one of
them.
"Hassan" <Hassan@.hotmail.com> wrote in message
news:%23ufF6kpQHHA.996@.TK2MSFTNGP02.phx.gbl...
> Does anyone have some basics to how a SAN is laid out ? I was on the HDS
> site and we are looking at the USP1100 and I came across terms like
> Directors,etc, but wish there was some basics on SANs someplace..
> Does anyone use USP1100 for SQL Servers and any pros and cons ?
>|||Mark,
Do you use the high end USP1100 ? If so, how many hosts can you connect to
it ? Do you ever have to take outages to all hosts to do some maintenance
work on the SAN or do you have all your hosts up and running all the time ?
"Mark Yudkin" <DoNotContactMe@.boingboing.org> wrote in message
news:OWRij$rQHHA.1200@.TK2MSFTNGP02.phx.gbl...
> We use HDS SAN with SQL Server.
> The best place for an introduction to SAN is a good book. Amazon gave me
> 705 hits, many at the "fundamentals" level. I suggest you start by buying
> one of them.
> "Hassan" <Hassan@.hotmail.com> wrote in message
> news:%23ufF6kpQHHA.996@.TK2MSFTNGP02.phx.gbl...
>> Does anyone have some basics to how a SAN is laid out ? I was on the HDS
>> site and we are looking at the USP1100 and I came across terms like
>> Directors,etc, but wish there was some basics on SANs someplace..
>> Does anyone use USP1100 for SQL Servers and any pros and cons ?
>

How many hosts can you connect to a SAN ?

Does anyone have some basics to how a SAN is laid out ? I was on the HDS
site and we are looking at the USP1100 and I came across terms like
Directors,etc, but wish there was some basics on SANs someplace..
Does anyone use USP1100 for SQL Servers and any pros and cons ?SAN vendors usually have general documentation explaining their architecture
components. That would be the best place to start.
As to the pros and cons of a particular product/model, you may get a diverse
array of opinions. For instance, we use a certain vendor and certain models.
We spent a lot of time evaluating different vendor products, and developed
our opinions. We like what we have. But then, it's not rare to bump into
folks who have chosen the vendor/product we decided against, and they seem t
o
be happy as well. For such an important decision, I'd ask the vendor for
customer references, even though you know you would be given only satisfied
customers.
As to the question of 'how many hosts can you connect ...', the answer is
entirely dependent on the SAN configuration.
Linchi
"Hassan" wrote:

> Does anyone have some basics to how a SAN is laid out ? I was on the HDS
> site and we are looking at the USP1100 and I came across terms like
> Directors,etc, but wish there was some basics on SANs someplace..
> Does anyone use USP1100 for SQL Servers and any pros and cons ?
>
>|||We use HDS SAN with SQL Server.
The best place for an introduction to SAN is a good book. Amazon gave me 705
hits, many at the "fundamentals" level. I suggest you start by buying one of
them.
"Hassan" <Hassan@.hotmail.com> wrote in message
news:%23ufF6kpQHHA.996@.TK2MSFTNGP02.phx.gbl...
> Does anyone have some basics to how a SAN is laid out ? I was on the HDS
> site and we are looking at the USP1100 and I came across terms like
> Directors,etc, but wish there was some basics on SANs someplace..
> Does anyone use USP1100 for SQL Servers and any pros and cons ?
>|||Mark,
Do you use the high end USP1100 ? If so, how many hosts can you connect to
it ? Do you ever have to take outages to all hosts to do some maintenance
work on the SAN or do you have all your hosts up and running all the time ?
"Mark Yudkin" <DoNotContactMe@.boingboing.org> wrote in message
news:OWRij$rQHHA.1200@.TK2MSFTNGP02.phx.gbl...
> We use HDS SAN with SQL Server.
> The best place for an introduction to SAN is a good book. Amazon gave me
> 705 hits, many at the "fundamentals" level. I suggest you start by buying
> one of them.
> "Hassan" <Hassan@.hotmail.com> wrote in message
> news:%23ufF6kpQHHA.996@.TK2MSFTNGP02.phx.gbl...
>sql

Monday, March 19, 2012

How many concurrent user connect to msde

Which one can tell me how many user can access to msde
server in same time?
You can have as many connections as you want. There is a limit of 8
concurrent work processes available but 3 of these are taken up by the system
"michael" wrote:

> Which one can tell me how many user can access to msde
> server in same time?
>
|||hi,
"Andrew" <Andrew@.discussions.microsoft.com> ha scritto nel messaggio
news:325C3340-D75F-49A7-960B-0564CB85B781@.microsoft.com...
> You can have as many connections as you want. There is a limit of 8
> concurrent work processes available but 3 of these are taken up by the
system[vbcol=seagreen]
> "michael" wrote:
you can have more than 8 concurrent workloads... this is not limited...
there's only the tradeoff that, up to the 9th concurrent workload, a delay
will be applied to all executing workloads in order to penalize all of them
more info at
http://msdn.microsoft.com/library/de...r_sa2_0ciq.asp ,
http://msdn.microsoft.com/library/de...r_sa2_6dip.asp
and
http://msdn.microsoft.com/library/de...r_sa2_0neh.asp
Andrea Montanari (Microsoft MVP - SQL Server)
http://www.asql.biz/DbaMgr.shtmhttp://italy.mvps.org
DbaMgr2k ver 0.8.0 - DbaMgr ver 0.54.0
(my vb6+sql-dmo little try to provide MS MSDE 1.0 and MSDE 2000 a visual
interface)
-- remove DMO to reply

Friday, February 24, 2012

How I solve this ?

I get this error when i try to connect with my sql,

I created my SQL with MS SQL 2005 Workgroup,

the error is:

Server Error in '/' Application.

The 'System.Web.Security.SqlMembershipProvider' requires a database schema compatible with schema version '1'. However, the current database schema is not compatible with this version. You may need to either install a compatible schema with aspnet_regsql.exe (available in the framework installation directory), or upgrade the provider to a newer version.

Description:An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details:System.Configuration.Provider.ProviderException: The 'System.Web.Security.SqlMembershipProvider' requires a database schema compatible with schema version '1'. However, the current database schema is not compatible with this version. You may need to either install a compatible schema with aspnet_regsql.exe (available in the framework installation directory), or upgrade the provider to a newer version.

First obvious question:

What happened when you extended the schema with ASPNET_REGSQL.EXE?

Jeff

|||I agree with Jeff. We need more details to help you. Any update?

Sunday, February 19, 2012

How I can connect...

How I can connect an ASP.NET application with MSDE2000
What have you read so far? Have you done any research into ADO.NET? I
suggest picking up one of the 30 or so books on the subject or take a look
at the documentation that clearly shows how to connect from any application
to SQL Server (including MSDE).
____________________________________
William (Bill) Vaughn
Author, Mentor, Consultant
Microsoft MVP
www.betav.com
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights.
__________________________________
"gilberto Prieto" <anonymous@.discussions.microsoft.com> wrote in message
news:2d98501c469e9$2a1c7120$a301280a@.phx.gbl...
> How I can connect an ASP.NET application with MSDE2000

how i can connect to table in SQL?

hi
i working on VB6 + SQL2000
i have table called (tblBuffer)
and want do something in my application everytime table added new record
(its like trigger in SQL)
thats mean if someone add new record to this table, this table call my
application to do some event.
now i made small monitor (working every 15 second) to see if table have new
record to do something, but this idea need network and SQL Resources.
some one have best idea?
--
Best Regards
Tark M. Siala
Development Manager
INTERNATIONAL COMPUTER CENTER (ICC.Networking)
Mobile: +218-91-3125900
E-Mail: tarksiala@.icc-libya.com
Messenger: tarksiala@.hotmail.com
Web Page: http://www.icc-libya.com
Blog: http://spaces.msn.com/tarksiala
======================================In SQL Server 2005 I would recommend the dependency service but in SQL 2000
the only thing I can think of is a trigger that uses sp_OA... commands to
call a COM object you write in VB.
This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm
"Tark Siala" <tarksiala@.icc-libya.com> wrote in message
news:O5QdxY8YGHA.4760@.TK2MSFTNGP03.phx.gbl...
> hi
> i working on VB6 + SQL2000
> i have table called (tblBuffer)
> and want do something in my application everytime table added new record
> (its like trigger in SQL)
> thats mean if someone add new record to this table, this table call my
> application to do some event.
> now i made small monitor (working every 15 second) to see if table have
> new record to do something, but this idea need network and SQL Resources.
> some one have best idea?
> --
> Best Regards
> Tark M. Siala
> Development Manager
> INTERNATIONAL COMPUTER CENTER (ICC.Networking)
> Mobile: +218-91-3125900
> E-Mail: tarksiala@.icc-libya.com
> Messenger: tarksiala@.hotmail.com
> Web Page: http://www.icc-libya.com
> Blog: http://spaces.msn.com/tarksiala
> ======================================
>