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

Thursday, March 29, 2012

Help with connecting to SQL database and binding

I am new to .net and I am using Visual Web Developer 2005 Express with SQL Server 2005 Express. What I would like to do is connect to my SQL database (which resides in the app_data folder) and open a table and pull out a field and place it in either a textbox or label on the page. No editing or deleting. Just simple one field binding. By the way, I can do this with all the cool built-in tools of VWD, but I want to know how to do it all by hand. I would really appreciate it if someone could help me out.

nate200@.hotmail.com:

I am new to .net and I am using Visual Web Developer 2005 Express with SQL Server 2005 Express. What I would like to do is connect to my SQL database (which resides in the app_data folder) and open a table and pull out a field and place it in either a textbox or label on the page. No editing or deleting. Just simple one field binding. By the way, I can do this with all the cool built-in tools of VWD, but I want to know how to do it all by hand. I would really appreciate it if someone could help me out.

This should give you an idea, it's a very manual example, no flashy tools:

http://aspnet.4guysfromrolla.com/articles/110905-1.aspx

Roger|||

Hey thanks that helped a lot! I got the code in place but when I view the page I don't get anything in my label. Here's my code.

<

formid="form1"runat="server"><asp:SqlDataSourceID="SqlDataSource1"runat="server"ConnectionString="<%$ ConnectionStrings:PollConn %>"SelectCommand="SELECT TOP 1 MemberNum FROM Members"></asp:SqlDataSource><asp:LabelID="Label1"runat="server"Text='<%# Bind("MemberNum") %>'></asp:Label></form>

What am I missing??

|||

nate200@.hotmail.com:

Hey thanks that helped a lot! I got the code in place but when I view the page I don't get anything in my label. Here's my code.

<formid="form1"runat="server">

<asp:SqlDataSourceID="SqlDataSource1"runat="server"ConnectionString="<%$ ConnectionStrings:PollConn %>"

SelectCommand="SELECT TOP 1 MemberNum FROM Members"></asp:SqlDataSource>

<asp:LabelID="Label1"runat="server"Text='<%# Bind("MemberNum") %>'></asp:Label>

</form>

What am I missing??

When using a data source you need to wrap a formview tag around the label, and bind the formview to the datasource.

Here's some samples of the formview tag:

http://www.asp.net/QuickStart/aspnet/doc/ctrlref/data/formview.aspx

Roger

Monday, March 26, 2012

Help with backups

Hi, I have a SQL server running on a remote network. On my local machine I
have the SQL client tools in which I use to connect to the SQL server. How
can I perform a backup locally. When I try, it looks at the remote drives
rather then my local drives when I try to backup to my local folder.
Thanks
David
You might try this:
backup database DB1 to disk = '\\mymachine\c:\mssql\backups\DB1_date.bck'
You could run that via SQL Analyzer or put it into a script or job.
hth.
"David" <dross@.si.rr.com> wrote in message
news:um2RfUZdEHA.2520@.TK2MSFTNGP12.phx.gbl...
> Hi, I have a SQL server running on a remote network. On my local machine
I
> have the SQL client tools in which I use to connect to the SQL server.
How
> can I perform a backup locally. When I try, it looks at the remote drives
> rather then my local drives when I try to backup to my local folder.
> Thanks
> David
>
sql

Help with backups

Hi, I have a SQL server running on a remote network. On my local machine I
have the SQL client tools in which I use to connect to the SQL server. How
can I perform a backup locally. When I try, it looks at the remote drives
rather then my local drives when I try to backup to my local folder.
Thanks
DavidYou might try this:
backup database DB1 to disk = '\\mymachine\c:\mssql\backups\DB1_date.bck'
You could run that via SQL Analyzer or put it into a script or job.
hth.
"David" <dross@.si.rr.com> wrote in message
news:um2RfUZdEHA.2520@.TK2MSFTNGP12.phx.gbl...
> Hi, I have a SQL server running on a remote network. On my local machine
I
> have the SQL client tools in which I use to connect to the SQL server.
How
> can I perform a backup locally. When I try, it looks at the remote drives
> rather then my local drives when I try to backup to my local folder.
> Thanks
> David
>

Help with backups

Hi, I have a SQL server running on a remote network. On my local machine I
have the SQL client tools in which I use to connect to the SQL server. How
can I perform a backup locally. When I try, it looks at the remote drives
rather then my local drives when I try to backup to my local folder.
Thanks
DavidYou might try this:
backup database DB1 to disk = '\\mymachine\c:\mssql\backups\DB1_date.bck'
You could run that via SQL Analyzer or put it into a script or job.
hth.
"David" <dross@.si.rr.com> wrote in message
news:um2RfUZdEHA.2520@.TK2MSFTNGP12.phx.gbl...
> Hi, I have a SQL server running on a remote network. On my local machine
I
> have the SQL client tools in which I use to connect to the SQL server.
How
> can I perform a backup locally. When I try, it looks at the remote drives
> rather then my local drives when I try to backup to my local folder.
> Thanks
> David
>

Sunday, February 26, 2012

Help switching to SQL Authentication

At the moment my asp.net app is working ok and I can connect to the database using windows authentication, however i'm trying to use sql authentication on my local computer.

i'm using sql server studio at the moment to manage the database. And tried numerious combinations of things to try and get it working and allow me to connect to the database using SQL authentication but still no luck :(

can anyone give me some rough step by step instructions to setting up the sql username and password for forms authentication and activating it for a certain database?

thanksWhen you say forms authentication, I assume you mean that in your web.config file you have something like this:

<authentication mode="Forms">
<forms loginUrl="Default.aspx" protection="Validation" timeout="300"/>
</authentication
If so, then a connection string that works connecting to sqlserver is this:

<add name="PolarIntegrationConnectionString2" connectionString="Data Source=INSP8600;Initial Catalog=PolarIntegration;Integrated Security=True"
providerName="System.Data.SqlClient" /
Let me know if that doesn't help.

Help SVP: How to connect to external server and backup db with SSMSExpress

Bonjour
You'll have to be gentil with me, because until today I had never worked with MS SQL (I was developing with Access).

Scenario & question:
I have installed a phpBB forum running on MS SQL on my clients server. Since Saturday this forum just won't load anymore. I have tested the connection to the SQL database within Macromedia Dreamweaver and it's fine. I can view the table and the data contained in them. I would like to re-install phpBB but I need to back up the db first.

I have installed SQL SERVER MANAGEMENT STUDIO EXPRESS, and all the other things like .NET 2.0 etc. It seems to work, as I can look at local SQL database samples, their table and data on my PC running XP Professional.

Question 1: How can connect to the external database? I have all the info necessary like ip address, name of the db, user name and password; but I can't seem to find a way to create an external connection from within the SSMSExpress. Could you please help.
Question 2: Once I am connected how can I backup the SQL db?

Many thanks in advance

W

When you run SSMS Express, it should give you a login screen where you can pick the server you want to log in to. You can also add servers in the Registered Servers windows.

To backup, you can go to Databases in the Object Explorer, select the database you want, right click on it and choose backup.

Thanks< MJ

|||

Thanks, done that and it works

W

Help SVP: How to connect to external server and backup db with SSMSExpress

Bonjour
You'll have to be gentil with me, because until today I had never worked with MS SQL (I was developing with Access).

Scenario & question:
I have installed a phpBB forum running on MS SQL on my clients server. Since Saturday this forum just won't load anymore. I have tested the connection to the SQL database within Macromedia Dreamweaver and it's fine. I can view the table and the data contained in them. I would like to re-install phpBB but I need to back up the db first.

I have installed SQL SERVER MANAGEMENT STUDIO EXPRESS, and all the other things like .NET 2.0 etc. It seems to work, as I can look at local SQL database samples, their table and data on my PC running XP Professional.

Question 1: How can connect to the external database? I have all the info necessary like ip address, name of the db, user name and password; but I can't seem to find a way to create an external connection from within the SSMSExpress. Could you please help.
Question 2: Once I am connected how can I backup the SQL db?

Many thanks in advance

W

When you run SSMS Express, it should give you a login screen where you can pick the server you want to log in to. You can also add servers in the Registered Servers windows.

To backup, you can go to Databases in the Object Explorer, select the database you want, right click on it and choose backup.

Thanks< MJ

|||

Thanks, done that and it works

W

Help SVP: How to connect to external server and backup db with SSMSExpress

Bonjour
You'll have to be gentil with me, because until today I had never worked with MS SQL (I was developing with Access).

Scenario & question:
I have installed a phpBB forum running on MS SQL on my clients server. Since Saturday this forum just won't load anymore. I have tested the connection to the SQL database within Macromedia Dreamweaver and it's fine. I can view the table and the data contained in them. I would like to re-install phpBB but I need to back up the db first.

I have installed SQL SERVER MANAGEMENT STUDIO EXPRESS, and all the other things like .NET 2.0 etc. It seems to work, as I can look at local SQL database samples, their table and data on my PC running XP Professional.

Question 1: How can connect to the external database? I have all the info necessary like ip address, name of the db, user name and password; but I can't seem to find a way to create an external connection from within the SSMSExpress. Could you please help.
Question 2: Once I am connected how can I backup the SQL db?

Many thanks in advance

W

When you run SSMS Express, it should give you a login screen where you can pick the server you want to log in to. You can also add servers in the Registered Servers windows.

To backup, you can go to Databases in the Object Explorer, select the database you want, right click on it and choose backup.

Thanks< MJ

|||

Thanks, done that and it works

W

help sql 2005 express

I have a computer_1 with sql 2005 express with app working fine, from another computer I want to connect to sql 2005 express in computer_1 using tcp/ip or named pipes, in computer_1 is enabled tcp/ip and named pipes, but when I connect using microsoft sql server management studio express I get this 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: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified) (Microsoft SQL Server, Error: -1)

another thing is when I put... osql -L in computer_1 .... (local)\sqlexpress not is listen

You need to enable SQL Browser and open the Firewall on your computer so that remote connections can talk to SQL Express.

Check out http://blogs.msdn.com/sqlexpress/archive/2005/05/05/415084.aspx for information on doing this.

Mike

Sunday, February 19, 2012

Help required Urgently: Intermittent connection failures

I am trying to connect to SQL Server from another box and I keep getting
this error intermittently.
DB-Library: Unable to connect: SQL Server is unavailable or does not exist.
Unable to connect: SQL Server does not exist or network access denied.
Net-Library error 10060: Connection (Connect()).
What could be the issues ?
-Nags
Hi,
This can be because of network issues. Can you execute a PING <Ipaddress>
command and
confirm that network is stable.
Thanks
Hari
MCDBA
"Nags" <nags@.DontSpamMe.com> wrote in message
news:eX2eXF#TEHA.3988@.TK2MSFTNGP10.phx.gbl...
> I am trying to connect to SQL Server from another box and I keep getting
> this error intermittently.
> DB-Library: Unable to connect: SQL Server is unavailable or does not
exist.
> Unable to connect: SQL Server does not exist or network access denied.
> Net-Library error 10060: Connection (Connect()).
> What could be the issues ?
> -Nags
>
|||Yes, we already tested it and the network is stable.
-Nags
"Hari" <hari_prasad_k@.hotmail.com> wrote in message
news:e2v4U7JUEHA.384@.TK2MSFTNGP10.phx.gbl...
> Hi,
> This can be because of network issues. Can you execute a PING <Ipaddress>
> command and
> confirm that network is stable.
> --
> Thanks
> Hari
> MCDBA
> "Nags" <nags@.DontSpamMe.com> wrote in message
> news:eX2eXF#TEHA.3988@.TK2MSFTNGP10.phx.gbl...
> exist.
>
|||Are these servers in the same subnet? Are they dual
homed? Perhaps the serving box is too busy? Perhaps a
bad patch cable? Are any other applications on this
server having problems connecting out?
Sincerly,
Invotion Engineering Team
Advanced Microsoft Hosting Solutions
http://www.Invotion.com
[vbcol=seagreen]
>--Original Message--
>Yes, we already tested it and the network is stable.
>-Nags
>"Hari" <hari_prasad_k@.hotmail.com> wrote in message
>news:e2v4U7JUEHA.384@.TK2MSFTNGP10.phx.gbl...
a PING <Ipaddress>[vbcol=seagreen]
box and I keep getting[vbcol=seagreen]
unavailable or does not[vbcol=seagreen]
network access denied.
>
>.
>
|||10060 = Connection Timeout.
Verify that the server doesn't have a personal firewall that is blocking
the client.
Make network traces on both the client and server and verify that the tcp 3
way handshake is completing.
Thanks,
Kevin McDonnell
Microsoft Corporation
This posting is provided AS IS with no warranties, and confers no rights.

Help required Urgently: Intermittent connection failures

I am trying to connect to SQL Server from another box and I keep getting
this error intermittently.
DB-Library: Unable to connect: SQL Server is unavailable or does not exist.
Unable to connect: SQL Server does not exist or network access denied.
Net-Library error 10060: Connection (Connect()).
What could be the issues ?
-NagsHi,
This can be because of network issues. Can you execute a PING <Ipaddress>
command and
confirm that network is stable.
Thanks
Hari
MCDBA
"Nags" <nags@.DontSpamMe.com> wrote in message
news:eX2eXF#TEHA.3988@.TK2MSFTNGP10.phx.gbl...
> I am trying to connect to SQL Server from another box and I keep getting
> this error intermittently.
> DB-Library: Unable to connect: SQL Server is unavailable or does not
exist.
> Unable to connect: SQL Server does not exist or network access denied.
> Net-Library error 10060: Connection (Connect()).
> What could be the issues ?
> -Nags
>|||Yes, we already tested it and the network is stable.
-Nags
"Hari" <hari_prasad_k@.hotmail.com> wrote in message
news:e2v4U7JUEHA.384@.TK2MSFTNGP10.phx.gbl...
> Hi,
> This can be because of network issues. Can you execute a PING <Ipaddress>
> command and
> confirm that network is stable.
> --
> Thanks
> Hari
> MCDBA
> "Nags" <nags@.DontSpamMe.com> wrote in message
> news:eX2eXF#TEHA.3988@.TK2MSFTNGP10.phx.gbl...
> exist.
>|||Are these servers in the same subnet? Are they dual
homed? Perhaps the serving box is too busy? Perhaps a
bad patch cable? Are any other applications on this
server having problems connecting out?
Sincerly,
Invotion Engineering Team
Advanced Microsoft Hosting Solutions
http://www.Invotion.com

>--Original Message--
>Yes, we already tested it and the network is stable.
>-Nags
>"Hari" <hari_prasad_k@.hotmail.com> wrote in message
>news:e2v4U7JUEHA.384@.TK2MSFTNGP10.phx.gbl...
a PING <Ipaddress>[vbcol=seagreen]
box and I keep getting[vbcol=seagreen]
unavailable or does not[vbcol=seagreen]
network access denied.[vbcol=seagreen]
>
>.
>|||10060 = Connection Timeout.
Verify that the server doesn't have a personal firewall that is blocking
the client.
Make network traces on both the client and server and verify that the tcp 3
way handshake is completing.
Thanks,
Kevin McDonnell
Microsoft Corporation
This posting is provided AS IS with no warranties, and confers no rights.

Help required

Psting For Charan,

Hi,

I am trying to connect MS SQL 2000 with C language using ODBC drivers in win 2k environment

i have a UTF 8 string stored in a nvarchar field of the MS SQL table and i am trying to retrieve this field from C and store it in a txt file
everythin is working perfectly fine the probs is that the UTF 8 string is not getting being retrieved correctly

Help Required Urgently

Tks in Adv
SsgI've replied to Charan when asked the same question via Private Message. Any scope of working on that topic.