Connecting to a SQL database on my website.

Hello,
I'm trying to create a login form that connects to a SQL database that's placed on my website. My problem is that I don't know how to connect to the database. Let's take these for an example:
Server the database is on: 10.246.16.159:3306
Database name: rhythmcheaters_
Database section: phpbb_users
Database password : 1A2b3C4d

Following Example will May  help You..
Try to design userinterface as like this..
Double on Login button a new method will be generated write the following code under that method..
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Data.SqlClient;
using System.Configuration;
using System.Security.Cryptography;
namespace windowsloginapp
    public partial class login : Form
        public string userName, Password;
        public int usercount;
        public login()
            InitializeComponent();
        private void button1_Click(object sender, EventArgs e)
            userName = textBox1.Text;
            Password = textBox2.Text;
            if (userName == "" && Password == "")
                MessageBox.Show("Please Enter User Name and Password");
            else
                string scn = ConfigurationManager.ConnectionStrings["Myconn"].ConnectionString.ToString();
                SqlConnection cn = new SqlConnection(scn);
                 cn.Open();
                 SqlCommand cmd = new SqlCommand("SP_logapp", cn);
                    cmd.CommandType = CommandType.StoredProcedure;
                    cmd.Parameters.AddWithValue("@Username", userName);
                    cmd.Parameters.AddWithValue("@Password", Password);
                    int usercount =(Int32) cmd.ExecuteScalar();
                        if (usercount == 1)
                            this.Hide();
                            Welcome w1 = new Welcome(userName);
                            w1.Show();
                        else
                            //login lg = new login();
                            //lg.Show();
                            MessageBox.Show("Not a Valid UserName and Password");
                        cn.Close();
APP.Config 
<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <connectionStrings>
    <add name="Myconn" connectionString="Data Source=10.246.16.159:3306;Initial
Catalog=rhythmcheaters_; user ID=phpbb_users;Password=1A2b3C4d;Integrated
security=sspi" providerName="system.data.sqlclient" />
  </connectionStrings>
</configuration>
Create database with the same name of(rhythmcheaters_) and declare 2 variables as username and password....
Insert some into that table...Do the same web application also..........It
will work...
Thanks & Regards RAJENDRAN M

Similar Messages

  • What's a better connection to an SQL database? ODBC or OLE DB

    NEw user here, but what would be a preferred way of connecting to my SQL database?  So far I have option of using ODBC (RDO) connection or OLE DB(ADO) connection. I'm not sure what the differences or when to use one or the other.
    Thanks

    I like OLE DB for the simply because it's "portable". With OLE DB the connection info is stored in the report. With ODBC, the report is using a system dsn connection. It means that if you want to send it to another user / computer, you also have to make sure the other computer has the same ODBC connection.
    In terms of performance... I've used both and have never seen a difference.
    Jason

  • Query regarding connecting dashboards with SQL DATABASE using WSDT

    Hello Sir,
    I am trying to connect dashboards with Sql database via WSDT, but i have encountered the same problem as described in your SAP community blog (SAP Web Service Design Tool: From web service creation to Xcelsius consumption).
    when i tried connecting CR server with WSDT ,it still shows that total number of available licenses is 0.
    What can be done to solve this issue.
    for your detail reference, we are using CRS NUL version's 60 days Evaluation keys and same with Xcelsius Departmental edition.
    I would really appreciate, if you revert back to my mail as soon as possible

    Which version of Crystal Reports are you using? The regular ReportDocument SDK probably isn't robust enough to handle this, unless you create a connection using that connection string at design-time which you don't change at runtime. You might be able to add those properties using the in-proc RAS SDK, though. This is available with CRXI R2 as of SP2, and CR2008.

  • Connecting to local SQL database

    I have tried everything to connect to a SQL database which is
    located on the same machine I'm using for development. Is there any
    special way of doing this. I tried to create a new connection in
    every way possible and I can't seem to be able to establish a
    connection. i would appreciate your input with this problem.
    Thank you,
    Marequi

    And posting your connection string would be helpful.
    Nancy Gill
    Adobe Community Expert
    BLOG:
    http://www.dmxwishes.com/blog.asp
    Author: Dreamweaver 8 e-book for the DMX Zone
    Co-Author: Dreamweaver MX: Instant Troubleshooter (August,
    2003)
    Technical Editor: DMX 2004: The Complete Reference, DMX 2004:
    A Beginner's
    Guide, Mastering Macromedia Contribute
    Technical Reviewer: Dynamic Dreamweaver MX/DMX: Advanced PHP
    Web Development
    "David Alcala - Adobe" <[email protected]>
    wrote in message
    news:efe94f$cia$[email protected]..
    > Are you using MS SQL Server? If so, what version?
    >
    > What server model are you using (ASP, ColdFusion, PHP,
    etc.)?
    >
    > How have you filled out the DW database connection
    dialog box so far?
    >
    > What error(s) are you seeing? Is the error in DW or in
    the browser?
    >
    > --
    > David Alcala
    > Adobe Product Support
    >

  • How to connect to Azure SQL database remotely (SharePoint 2013 BI)

    Hi,
    I am new to using Azure VM's and I am looking for advice. I have created and can connect to an Azure VM with a SQL Server 2012 installed on it (includes SSAS and SSRS). I connect to the VM using Microsoft Remote Desktop Connection.
    The problem I am having is connecting to the Azure database from a SharePoint BI site. Are there any good videos or websites that demonstrate how to setup an Azure VM so a user can access a database remotely.
    I hope you can help. 
    ATaylor

    Hello,
    To connect to the SQL Server Database from another computer, you must know the Domain Name System (DNS) name of the Azure virtual machine. For example: DNSName,portnumber such as SQLVM.cloudapp.net,57500.
    (Note: The port number is the public endpoint port which you can configure in the management portal for TCP communication with SQL Server on Azure VM.)
    As for datasource credentials, you can use a SQL Server authentication login: create a SQL Server login with password on the SQL Server instance.
    Reference:
    Complete Configuration steps to connect to the virtual machine Using SQL Server Management Studio on another computer
    Regards,
    Fanny Liu
    Fanny Liu
    TechNet Community Support

  • Can No Longer Connect to Azure SQL Databases

    As of this morning, I am no longer to connect to any of my Azure SQL databases by any (apparent) means. I checked the configuration in the azure portal and my IP address is listed as an allowed IP, however:
    I am unable to connect via SQL Server Management Studio
    My request times out when attempting to visit https://{server_name}.database.windows.net
    What might have caused this?

    Hi ,
    Thanks for posting here.
    To resolve the issue you can try the following steps (in that order):
                    Check the application’s connection string to make sure that it is correctly configured. For example, make sure that the connection string specifies the correct port
    (1433) and the fully qualified server name.                
    Note You can follow these steps to obtain the connection string from the Azure Management Portal:                  
                          Log on to the
    Azure Management Portal.                    
                          In the left navigation pane, click
    SQL Databases.                    
                          Select your Azure SQL Database server.                    
                          Click
    Dashboard.                    
                          On the right side, go to the
    quick glance section, and then click Show connection strings.                    
                    Make sure that TCP IP is enabled as a client protocol on the application server. For more information on how to do this, see
    Configure client protocols. On application servers where you do not have SQL Server tools installed, you can check this by running cliconfg.exe (SQL Server Client Network Utility).              
                    Test the connectivity between the application server and the Azure SQL database by using a UDL file, ping, and telnet. For more information about how to do this,
    see
    Azure SQL Database connectivity troubleshooting guide and
    Troubleshooting SQL Server connectivity issues.                
    Note As a troubleshooting step, you can also try to test the connectivity on a different client computer.                
                    Try increasing the connection
    timeout. Microsoft recommends using a connection timeout of at least 30 seconds.              
                    As a best practice ensure retry logic is in place. For more information about the retry logic, see
    Azure SQL Database best practices to prevent request denials or connection termination.              
                  If the previous steps do not resolve your problem, follow these steps to collect more data and contact support:              
                      If your application is a cloud service, enable the logging. This step returns a UTC time stamp of the failure. Additionally, SQL Azure returns the tracing
    ID.
    Microsoft Customer Support Services can use this information.                
                      For more information about how to enable the logging, see
    how to enable diagnostic logging for Azure Web sites and Developing SQL Database Applications section in
    Azure SQL Database Development Considerations.
    Please write back with the exact Error message/ Error Code if this doesn't help.
    Regards,
    Shirisha Paderu.

  • Cannot Connect to Azure SQL Database in Visual Studio 2013

    Beyond Frustrated here.
    I am trying to connect to an Azure SQL database - it has been created, has tables etc. I am trying to create a new Data Connection from within Visual Studio 2013, latest release for VS and Azure. I continue to receive the following error:
    A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections.
    (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server) (Microsoft SQL Server, Error: 53)
    I have ensured that TCP is allowed and above Named Pipes in the Configuration Manager. The associated IP address is allowed on Azure Firewall. Certificate has been added to VS etc. But still no connection. I can see the database in the Azure section in Server
    Explorer, but cannot add a Data Connection. What is equally as frustrating is I have a MacBook Pro running Win 7 sitting right next to my office computer and it can access Azure fine, not problems.
    If anyone has any other ideas on how I might be able to solve this I would love to hear them. Thanks in advance.
    Jeff

    Hi,
     The Error message "   A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is
    configured to allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server) (Microsoft SQL Server, Error: 53) "
    The issue comes up mainly because the application is not able to connect to the server.
    To resolve this issue, try the following steps (in that order):
     Make sure that TCP IP is enabled as a client protocol on the application server. For more information on how to do this, see
    Configure client protocols. On application servers where you do not have SQL Server tools installed, you can check this by running cliconfg.exe (SQL Server Client Network Utility).              
     2.  Check the application’s connection string to make sure that it is correctly configured. For example, make sure that the connection string specifies the correct port (1433) and the fully qualified server name.                
    Note You can follow these steps to obtain the connection string from the Azure Management Portal:                  
                          Log on to the
    Azure Management Portal.                    
                          In the left navigation pane, click
    SQL Databases.                    
                          Select your Azure SQL Database server.                    
                          Click
    Dashboard.                    
                          On the right side, go to the
    quick glance section, and then click Show connection strings.                    
    Test the connectivity between the application server and the Azure SQL database by using a UDL file, ping, and telnet. For more information about how to do this, see
    Azure SQL Database connectivity troubleshooting guide and
    Troubleshooting SQL Server connectivity issues.                
    Note As a troubleshooting step, you can also try to test the connectivity on a different client computer.                
    Try increasing the connection timeout. Microsoft recommends using a connection timeout of at least 30 seconds.              
    As a best practice ensure retry logic is in place. For more information about the retry logic, see
    Azure SQL Database best practices to prevent request denials or connection termination.              
          If these  steps do not resolve your problem, follow the below steps to collect more data and contact support:              
       If your application is a cloud service, enable the logging. This step returns a UTC time stamp of the failure. Additionally, SQL Azure returns the tracing ID.
    Microsoft Customer Support Services can use this information.                   
       For more information about how to enable the logging, see
    how to enable diagnostic logging for Azure Web sites and Developing SQL Database Applications section in
    Azure SQL Database Development Considerations.                
      Check out
    the list of best practices for Connecting to Windows Azure SQL Database.
    Regards,
    Shirisha Paderu.

  • Consistently getting "The wait operation timed out" when connecting to Azure SQL Database from a virtual instance...

    I have a web app that is backed by a an Azure SQL Database. The problem is that I had multiple issues when connecting to the database mainly when trying to establish a connection, or timeouts. This is the log I just encountered when trying to use the web
    app.
    [Win32Exception (0x80004005): The wait operation timed out]
    [SqlException (0x80131904): Connection Timeout Expired. The timeout period elapsed while attempting to consume the pre-login handshake acknowledgement. This could be because the pre-login handshake failed or the server was unable to respond back in time. The duration spent while attempting to connect to this server was - [Pre-Login] initialization=21970; handshake=1; ]
    System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, UInt32 waitForMultipleObjectsTimeout, Boolean allowCreate, Boolean onlyOneCheckConnection, DbConnectionOptions userOptions, DbConnectionInternal& connection) +671
    System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, TaskCompletionSource`1 retry, DbConnectionOptions userOptions, DbConnectionInternal& connection) +116
    System.Data.ProviderBase.DbConnectionFactory.TryGetConnection(DbConnection owningConnection, TaskCompletionSource`1 retry, DbConnectionOptions userOptions, DbConnectionInternal& connection) +1012
    System.Data.ProviderBase.DbConnectionClosed.TryOpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource`1 retry, DbConnectionOptions userOptions) +6712291
    System.Data.SqlClient.SqlConnection.TryOpen(TaskCompletionSource`1 retry) +152
    System.Data.SqlClient.SqlConnection.Open() +229
    System.Data.EntityClient.EntityConnection.OpenStoreConnectionIf(Boolean openCondition, DbConnection storeConnectionToOpen, DbConnection originalConnection, String exceptionCode, String attemptedOperation, Boolean& closeStoreConnectionOnFailure) +102

    Hi Affar2k,
    According to your description, we need to verify if there is no network issue and the Sqlclient version is older than .NET 4.5.  You can try to connect to the Windows Azure SQL database via SSMS and check if it can run well. When you
    connect to the SQL Azure database via ADO.NET, you need to verify that the server name and passwords are right in the connection string.
    For more information, you can review the following article about how to connect to Windows Azure SQL Database using ADO.NET.
    http://msdn.microsoft.com/en-us/library/windowsazure/ee336243.aspx
    Thanks,
    Sofiya Li
    Sofiya Li
    TechNet Community Support

  • Applet connecting to MS SQL Database (Remote DataSourse)

    Hello,
    I started by building my interface to a Database within an Application. I am not to the point where I am ready to make it an applet but want to get some tips when the time comes very soon.
    First of all what security issues do I have to deal with to let the applet connect to the database?
    Second I currently created a local Datasource via ODBC call JavaDB and linked it to my MS SQL Database.
    QUESTION
    How do I link to the with a remote Datasource so that the local machine does not have to worry about the datasource.
    Lastly can I use the "sun.jdbc.odbc.JdbcOdbcDriver" in an applet. I sure hope so...
    Then the part of my code that connected to the database was this:
    private void initDB(){
    String url = "jdbc:ODBC:JavaDB";
    Connection con;
    String query = "select * from COFFEES";
    Statement stmt;
    try {
    //Class.forName("myDriver.ClassName");
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    } catch(java.lang.ClassNotFoundException e) {
    System.err.print("ClassNotFoundException: ");
    System.err.println(e.getMessage());
    try {
    con = DriverManager.getConnection(url, DBADM, DBPWD);
    stmt = con.createStatement();                                   
    ResultSet rs = stmt.executeQuery(query);
    ResultSetMetaData rsmd = rs.getMetaData();
    System.out.println("");
    int numberOfColumns = rsmd.getColumnCount();
    for (int i = 1; i <= numberOfColumns; i++) {
         if (i > 1) System.out.print(", ");
         String columnName = rsmd.getColumnName(i);
         System.out.print(columnName);
    System.out.println("");
    while (rs.next()) {
         for (int i = 1; i <= numberOfColumns; i++) {
         if (i > 1) System.out.print(", ");
         String columnValue = rs.getString(i);
         System.out.print(columnValue);
         System.out.println("");     
    stmt.close();
    con.close();
    } catch(SQLException ex) {
    System.err.print("SQLException: ");
    System.err.println(ex.getMessage());
    Thanks,
    Kenny

    Kenny,
    As no one has replied, I've managed to implement a database that uses applets.
    Firstly, one needs to obtain a JSP server (apache tomcat is free and can be configured into a IIS 4 server).
    Secondly, write all the DB connection stuff within a jsp page (ex.) "builders.jsp"
    <%@ page import="java.sql.*" %>
    <%!
    protected String driver="sun.jdbc.odbc.JdbcOdbcDriver";
    protected String url="jdbc:odbc:PhotoDBase";
    protected String userid=null;
    protected String passwd=null;
    %>
    <html><head><title>Builder Example</title></head><body>
    <%!
    public static String GET_BUILDER_QUERY =
    "SELECT * FROM BuilderInfo WHERE BuilderID =?";
    %>
    <%
    String bID = "24"; //normally this would use
    //request.Parameter("bID");
    //in order to pull up a specific
    //record. In this test case it is
    //hard coded to pull only builder #24
    %>
    <%
    Class.forName(driver);
    Connection conn = DriverManager.getConnection(url, userid, passwd);
    PreparedStatement stmt = conn.prepareStatement(GET_BUILDER_QUERY);
    stmt.setString(1, bID);
    ResultSet rs = stmt.executeQuery();
    rs.next();
         String buildID = rs.getString("BuilderID");
         String bName = rs.getString("BuilderName");
         String bAddress = rs.getString("Address");
         String bCity = rs.getString("City");
         String bState = rs.getString("State");
         String bZip = rs.getString("Zip");
         String bCName = rs.getString("ContactName");
         String bCLast = rs.getString("ContactLast");
         String bPhone = rs.getString("Phone");
         String bFax = rs.getString("Fax");
         String bMobile = rs.getString("Pager/Cell");
    rs.close();
    stmt.close();
    if (bName == null)
         bName = "No Builder";
    if (bAddress == null)
         bAddress = "N/A";
    if (bCity == null)
         bCity = "N/A";
    if (bState == null)
         bState = "N/A";
    if (bZip == null)
         bZip = "N/A";
    if (bCName == null)
    bCName = "N/A";
    if (bCLast == null)
         bCLast = "N/A";
    if (bPhone == null)
         bPhone = "N/A";
    if (bFax == null)
    bFax = "N/A";
    if (bMobile == null)
    bMobile = "N/A";
    %>
    <p>Builder: <%= bName%> BuilderID #: <%= buildID%>
    <br>Contact: <%= bCName%> <%= bCLast%>
    <br>Address: <%= bAddress%>
    <br><%= bCity%>, <%= bState%> <%= bZip%>
    <br>Phone: <%= bPhone%>
    <br>Fax: <%= bFax%>
    <br>Mobile: <%= bMobile%>
    <p><applet code="Build.class" width="600" height="300">
    <param name=buildID value=<%= buildID%>>
    <param name=bName value="<%= bName%>">
    <param name=bAddress value="<%= bAddress%>">
    <param name=bCity value="<%= bCity%>">
    <param name=bState value="<%= bState%>">
    <param name=bZip value="<%= bZip%>">
    <param name=bCName value="<%= bCName%>">
    <param name=bCLast value="<%= bCLast%>">
    <param name=bPhone value="<%= bPhone%>">
    <param name=bFax value="<%= bFax%>">
    <param name=bMobile value="<%= bMobile%>">
    </applet>
    </body>
    </html>
    The jsp gets the data from the DB based on the parameter bID which would be passed to it via a search or input page with various error checking included.
    The applet then recieves its data via parameters. (Build.class has been shortened here to show you the meat and potatoes of the whole deal)
    //<applet code="Build.class" width="600" height="300"></applet>
    import java.awt.*;
    import java.awt.Event;
    import java.applet.Applet;
    import java.io.*;
    public class Build extends java.applet.Applet {
    protected Panel search ;
    protected TextField Nametxt ;
    protected TextField Loctxt ;
    protected TextField Citytxt ;
    protected TextField Statetxt ;
    protected TextField Ziptxt ;
    protected TextField CNametxt ;
    protected TextField CLasttxt ;
    protected TextField Phonetxt ;
    protected TextField Faxtxt ;
    protected TextField Celltxt ;
    public Build(){
    super();
    search = new Panel();
    Nametxt = new TextField();
    Loctxt = new TextField();
    Citytxt = new TextField();
    Statetxt = new TextField();
    Ziptxt = new TextField();
    CNametxt = new TextField();
    CLasttxt = new TextField();
    Phonetxt = new TextField();
    Faxtxt = new TextField();
    Celltxt = new TextField();}
    public void init(){
         BorderLayout bl = new BorderLayout();
         setLayout(bl);
         add(search, "Center");
         setBackground(Color.white);
         String buildID = getParameter("buildID");
         String bName = getParameter("bName");
         String bAddress = getParameter("bAddress");
         String bCity = getParameter("bCity");
         String bState = getParameter("bState");
         String bZip = getParameter("bZip");
         String bCName = getParameter("bCName");
         String bCLast = getParameter("bCLast");
         String bPhone = getParameter("bPhone");
         String bFax = getParameter("bFax");
         String bMobile = getParameter("bMobile");
    Nametxt.setText(bName);
    Loctxt.setText(bAddress);
    Citytxt.setText(bCity);
    Statetxt.setText(bState);
    Ziptxt.setText(bZip);
    CNametxt.setText(bCName);
    CLasttxt.setText(bCLast);
    Phonetxt.setText(bPhone);
    Faxtxt.setText(bFax);
    Celltxt.setText(bMobile);
    Hope this will aid you in yours and anyone elses endevours.
    James <[email protected]>

  • Connecting to Azure SQL database in Access 2010

    I've recently purchased a new computer and I had an OBDC connection set up to link to a sql database in azure through access. I am trying to set it up on my new computer but I'm unable to define the specific database. I'm able to make the connection but
    it only allows me into the master database. I've added my IP address in the configure servers but still can't get things to work. Any help would be greatly appreciated.
    thanks
    Lynn

    Hi,
    The following guidelines apply to SQL Database connections using ODBC:
    • When using SQL Server Native Client from SQL Server 2008 R2 or SQL Server 2008, the connection string must include the server name as part of the user name (user@server).
    • You must use TCP/IP as the protocol when connecting to an Azure SQL Database.
    • You cannot create a table in the master database, so therefore you must create a user database to create a table.
    • You cannot execute a use database command to switch to your user database. You must disconnect and connect directly to the user database.
    • You must have a primary key or clustered index on your table to be able to insert data.
    Ref:
    https://msdn.microsoft.com/en-us/library/azure/hh974312.aspx?f=255&MSPPError=-2147217396
    http://blogs.office.com/2010/06/07/access-2010-and-sql-azure/
    https://support.microsoft.com/en-us/kb/2028911/
    Hope this helps you.
    Girish Prajwal

  • Need help connecting a MS Sql Database in CF Administrator

    Good morning,
    I`m hoping someone out there can help me.
    I simply want to add a MS SQL datasource within Coldfusion Administrator.
    I have connected to it successfully with Sql Server Management Studio, using Windows Authentication.
    I`m assuming I need to use Windows Authentication to connect within Coldfusion Administrator
    How do I fill out these fields then:
    because I am getting this error:
    Connection verification failed for data source: test
    java.sql.SQLNonTransientConnectionException: [Macromedia][SQLServer  JDBC Driver]Error establishing socket. Unknown host: local
    The root cause was that:  java.sql.SQLNonTransientConnectionException: [Macromedia][SQLServer JDBC  Driver]Error establishing socket. Unknown host: local
    I have also tried it with localhost as opposed to local.
    Please help?
    Thanks;
    Rhonda

    I believe you DON'T.
    ColdFusion, by default, does not run as any type of user that would work with Windows Authentication.  It can be set up to do so, through the windows services panel.  You configure the ColdFusion service(s) to "Log On As" some windows domain account with the desired permissions.  This is normally done to allow CFML code to access network resources for file operations and the like.
    But, I don't know if that is good enough for a connection to a SQL server.  I've never had to deal with it myself (I have operations and database administrators types who deal with this for me).  But I have read many many times on forums like this that the default security configuration of SQL server does not work with ColdFusion.  That one has to set up an alternate configuration in SQL, TCP/IP I think?

  • Question on InfoView  Multiple Connections opening on SQL Database

    Hi, we are using Business Objects XI Release 2 and I am having an ODBC issue to a SQL 2005 database.  I have a Crystal XI report that contains 2 parameters and selects roughly 100,000 rows of data and summarizes the data to 1 page.  In Crystal Developer it runs fine in several seconds.  Within Infoview it runs fine if I do a schedule now and select the parameters.  The Issue is if I click on the published report, update the parameters, it then starts to run and run.  Looking at the database it opens roughly 32 connections and just keeps opening and closing connections.  Since I am invoking infoview through a url it is running on the same server that I can schedule on.  I am not sure where or what the problem is, why so many connections open and the report never finishes.  Also the connections are bogging down the SQL Database due to high CPU utilization.  Any help/insight/explanations would be appreciated.
    Thank You

    Thanks for the response, see my responses in Italics,
    If you try to run the report with multiple connections are you facing this problem, or else is it for all reports.
    I am not trying to run for multiple connections intentionally?  Is there a setting in the report itself or on the console that could be doing this?
    Have tried to run the report other than the same machine where you have sever installed.
    I have run the report from 2 different viewers which reside on different machines, both separate from the
    database.  If I run from Crystal Developer on a desktop it is fine.  Also if I schedule in the viewer it is fine.  It seems like when I run on demand (not sure if my terminology is correct).
    Also try with remote connection to logon to your server and try to run the report and observe if there is any specific error. 
    I am executing a url that is on the server where Business Objects is installed.
    Regards,
    Naveen.
    I

  • Can't connect to SQL Database using new login

    I can connect to Azure SQL Database using the admin ID created when I set up the Azure account.  Now I want to set up a different login that has only regular read/write privileges.  I have followed the instructions on several web posts, to create
    a login at the server level, then create a user at the database level from the login.  When I try to connect, though, the connection fails.  I get an error message, and a GUID that I am supposed to supply to MS tech support, except that all I have
    is a standard Azure subscription, which does not include tech support.
    Here is what I have done so far:
    Logging in to the server with the admin account with SQL Mgmt Studio, I go to the master database on my Azure server, and create the login:
    CREATE LOGIN clouduser@gxw8x04nlb with PASSWORD = 'xoxoxoxo';
    This appears to work (password supplied is a "strong" password), or at least it doesn't show any error response.
    Then, connecting to the production database in Azure, I set up a user and set permissions as follow:
    CREATE USER clouduser1 FROM LOGIN clouduser@gxw8x04nlb;
    EXEC sp_addrolemember 'db_datareader', 'clouduser1'
    EXEC sp_addrolemember 'db_datawriter', 'clouduser1'
    When I attempt to connect to Azure using the new login, however, I get an error message (from SQL Mgmt Studio as well as from MS Access).  I am using the SQL Server Native Client 10.0.
    The message is:
    Connection failed:
    SQLState '28000'
    SQL Server Error 18456
    [Microsoft][SQL Server Native Client 10.0][SQL Server]Login failed for user 'clouduser'.
    Connection failed:
    SQLState: '01000'
    SQL Server Error: 40608
    [Microsoft][SQL Server Native Client 10.0][SQL Server]This session has been assigned a tracing ID of
    '271851d5-8e94-497c-a332-d9d40682bb7a'.  Provide this tracing ID to customer support when you need assistance.
    Is there some missing step I need to do, to permit the login to see the database?  I have looked for such in the various discussions about connection problems, but have not been able to find such a thing.   Or extend more permissions to the new
    user? Or specify a default user ID for a given login ?  (as they do not have the same names, in the examples I have seen).  I tried making the user ID the same as the login (w/o the server name), but that didn't seem to help, either.
    I have done numerous web searches, and tried about every variation of login or user ID, password, etc. that I can think of, and all of them encounter the same error.  It's got to be something very simple - clearly Azure supports more than one login
    per database.  But's that's all I have at the moment.  That login connects just fine, but others won't, using the same PC, middleware, IP address, etc.
    Any help would be much appreciated -
    Thanks,
         Doug

    Olaf -
    I noticed that, but all of the examples I have seen have Users named slightly differently from the Logins.  I did try logging in with the Login name instead.  No good.  I tried making the Login and the User name the same (clouduser).  Also
    no good - same symptoms.
    I think the problem is that the initial creation of the Login needs to be done WITHOUT the server name on the end.  
    Logged in to the master DB, I tried:  Create LOGIN clouduser@gxw8x04nlb with PASSWORD = 'xoxoxoxo';
    That didn't give me an error message, but I think it created a LOGIN of 'clouduser@gxw8x04nlb'.  When
    referenced from the outside world, I would need to specify 'clouduser@gxw8x04nlb@gxw8x04nlb'.
    I tried deleting the logins, and then creating the login 'clouduser' in the Master DB.  Then in
    the application DB, I created User clouduser from LOGIN clouduser, and then assigned a role.  That seems to work!
    In my connection string, File DSN, etc. I still need to supply the login as 'clouduser@gxw8x04nlb'.
     But when I am logged in to the server, and working in the Master DB or the application DB, I just refer to the Login as 'clouduser'.  
    Seems a little more complicated than it really should be, but at least I now have something that works.
    Doug
    Doug Hudson

  • Best practise for creating an application that connects to a SQL Server database

    I have created an application that connects to a SQL Server database and views information using a datagrid and performs several updates when a button
    is selected.  
    I have created a SQLcontrol.vb using the following code:
    Imports System.Data.Sql
    Imports System.Data.SqlClient
    Public Class SQlControl
    'connection 1
        Public SQLCon As New SqlConnection With {.ConnectionString
    = "Data Source=;Initial Catalog=;Integrated Security=True"}
    'connection 2
        Public SQLCon1 As New SqlConnection With {.ConnectionString
    = "Data Source;Initial Catalog=;Integrated Security=True"}
        Public sqlcmd As SqlCommand
        Public sqlda As SqlDataAdapter
        Public sqldataset As DataSet
        Public Function hasconnection() As Boolean
            Try
                SQLCon.open()
                SQLCon.close()
                Return True
            Catch ex As Exception
                MsgBox(ex.Message)
                Return False
            End Try
        End Function
        Public Sub runquery(query As String)
            Try
                SQLCon.Open()
                sqlcmd = New SqlCommand(query,
    SQLCon)
                'LOAD
    SQL RECORDS FOR DATAGROD
                sqlda = New SqlDataAdapter(sqlcmd)
                sqldataset = New DataSet
                sqlda.Fill(sqldataset)
    BH READ DIRECTLY FROM THE DATABASE
                'Dim
    R As SqlDataReader = sqlcmd.ExecuteReader
                'While
    R.Read
                'MsgBox(R.GetName(0)
    & ": " & R(0))
                'End
    While
                SQLCon.Close()
            Catch ex As Exception
                MsgBox(ex.Message)
                'will
    close connection if still open
                If SQLCon.State
    = ConnectionState.Open Then
                    SQLCon.Close()
                End If
            End Try
        End Sub
        Public Sub runquery1(query As String)
            Try
                SQLCon1.Open()
                sqlcmd = New SqlCommand(query,
    SQLCon1)
                'LOAD
    SQL RECORDS FOR DATAGROD
                sqlda = New SqlDataAdapter(sqlcmd)
                sqldataset = New DataSet
                sqlda.Fill(sqldataset)
    BH READ DIRECTLY FROM THE DATABASE
                'Dim
    R As SqlDataReader = sqlcmd.ExecuteReader
                'While
    R.Read
                'MsgBox(R.GetName(0)
    & ": " & R(0))
                'End
    While
                SQLCon1.Close()
            Catch ex As Exception
                MsgBox(ex.Message)
                'will
    close connection if still open
                If SQLCon1.State
    = ConnectionState.Open Then
                    SQLCon1.Close()
                End If
            End Try
        End Sub
    End Class
    A code for one of my button which views displays data grid contains the following code:
    Private Sub Button1_Click_1(sender As Object,
    e As EventArgs) Handles Button1.Click
            If SQL.hasconnection
    = True Then
                SQL.runquery("select 
    * from tablea")
                If SQL.sqldataset.Tables.Count
    > 0 Then
                    DGVData.DataSource = SQL.sqldataset.Tables(0)
                End If
            End If
        End Sub
    I am fairly new to vb.net and have read a few books and followed a few tutorials on youtube, what I would like to know is, are there any disadvantages
    to the way I have connected to a SQL database using the SQLControl.vb.  A lot of the vb books include data adapter and dataset within the form, I'm not sure if I'm following best practice by have the connection details outside of the form.
    My other question is, I have created two connections in the SQLControl and call these connections within the same form using the same data adapter
    and dataset.  It all works fine but I just wanted to know of any potential issues?
    Public SQLCon As New SqlConnection With {.ConnectionString
    = "Data Source=;Initial Catalog=;Integrated Security=True"}
    'connection 2
        Public SQLCon1 As New SqlConnection With {.ConnectionString
    = "Data Source;Initial Catalog=;Integrated Security=True"}
    Thanks

    My other question is, I have created two connections in the SQLControl and call these connections within the same form using the same data adapter and dataset.  It all works fine but
    I just wanted to know of any potential issues
    1) You are not using Sepration of concerns for a solution that is doing data access, like using a DAL.
    http://en.wikipedia.org/wiki/Separation_of_concerns
    2) You are directly issuing SQL commands at the UI, leading to sql injection attacks.
    3) You are not using a UI design pattern, which leads you to tightly couple database activity to the UI.
    http://www.codeproject.com/Articles/228214/Understanding-Basics-of-UI-Design-Pattern-MVC-MVP
    @System243trd, parameters are important to prevent SQL injection attacks (people will insert SQL commands into the database if you do not perform basic checking of what you are passing to the database). If you write a stored procedure try to make
    the variables the correct SQL server data type to avoid problems later of people trying to call it directly.  Darnold924 is right, I see no code to prevent against SQL injection attacks. In addition, during development in some instances LocalSQLDB
    database system is used and during deployment you usually need to use the production SQL server database. Moreover,  Linq-to-SQL is used on Windows Phone 8.1 and it is required for phone development later and so I highly recommend learning
    it if you plan on developing windows phone applications.
    @System243trd, If you want the code for the windows phone app I think it uses the MVVM model or that might be for universal apps or regular windows phone apps. I have been using the windows phone Silverlight pivot or panorama template (it might
    be pieces of both). I've already submitted to the windows phone marketplace and it had to go through certification first. I plan on later making an article on it but I need to first fix one or two simple problems I have with it.  Here's a link to
    the source code if you later want to look at the source code (in vb.net): 
    https://jeffsblogcodesamples.codeplex.com/downloads/get/1445836
    Once you eliminate the impossible, whatever remains, no matter how improbable, must be the truth. - Sherlock Holmes. speak softly and carry a big stick - theodore roosevelt. Fear leads to anger, anger leads to hate, hate leads to suffering - Yoda. Blog
    - http://www.computerprofessions.us

  • Connecting to an Azure SQL Database from a Windows C# Form

    Hi,
    Is it possible to connect to an SQL database in Azure from Visual Studio C# 2010 or 2012? If so how is this done. Is it the same as if you were connecting to SQL Express database with the use of a connection string? Any directions or tutorials would be of
    great help!
    Thanks!

    Hi,
    >>Thanks for the reply Paul, That is disappointing. I am trying to get my students to create a C# application that will connect with a database in Azure. Is there another approach besides SQL that I could use?
    Using SQL Azure will work fine (see below), if the students are familiar with SQL Server and SQL Databases it will be great for them to see how it works in the cloud. As an alternative you could explore Azure Storage, using Table Storage, Blob Storage or
    the new Document Database features.
    >>Azure enforces a firewall that prevents direct external access to the database server. You can add a firewall rule allowing external access, but the rules only support connecting from a fixed IP address because you have to specify the numeric IP
    from which connection will be allowed.
    You can specify ranges here, so you could cover a range of IP addresses. You can even specify 0.0.0.0 to 255.255.255.255 and allow all IP addresses, this could be an option if you don't know where the students will be connecting from, and you are using a
    database for the exercise where you don't care too much about the security.
    When I have run classes I typically use an IP address range, for example XXX.YYY.ZZZ.0 to XXX.YYY.ZZZ.255 if the students are accessing from the same classroom, and the external IP address may vary. You may find that they all have the same external IP address
    if they are on the same internal network.
    Also, with many students accessing the same database, you may get throttling if they place a lot of load on it. This is cool, as you can also teach them about transient fault handling and resource throttling :-).
    Regards,
    Alan
    Free e-book: Windows Azure Service Bus Developer Guide.

Maybe you are looking for

  • Service Contracts  with billing plan not updating debit memo request in ECC

    For service contracts with billing plan, we cancel the line items and set the user status at header to "cancelled" and also set the cancellation date (under Cancellation Tab) at the header as well as item level which delete all items in the “DMR” in

  • Movieclip rotation duplication

    Hello all, I have been battling with this for some time now so some advice would be so great! I need to create a button that will show a movieclip on the centre of the stage but also when you click the same button many times the movieclip on the stag

  • Substitution variable on unix

    All, How do I make a sql statement prompt for a value on unix using the '&' parameter? When I run the following section (on HP Unix), the statement goes right through without prompting the user. Thanks as Always A/A Code sqlplus username/password <<-

  • How can I retrieve 'ign' table

    Dear All, I was getting ORA-01452: cannot CREATE UNIQUE INDEX; duplicate keys found in homogeneous system copy and during system import i skipped that table(SAPSR3.TPALOG)  on which ORA-01452 error was occurring mean i just change the 'err' with 'ign

  • Can a Fn return a recordset?

    How do I have oracle store a SQL statement that can have params passed in, and have a recordset returned to user when executed? Is this done w/ a function? For example, I want to store the following code: create procedure/function/?? empname IDNum as