Applet / SQL Database communication

I am developing an applet that needs to connect to a SQL Database to keep track of a variety of information. I am running into some errors when I try to connect to the database.
Can anyone tell me the best way for an applet to connect to a SQL database without editing the client's policy file to give permission?
Any help with this matter would be much appreciated.
Thanks.

I am developing an applet that needs to connect to a
SQL Database to keep track of a variety of
information. I am running into some errors when I
try to connect to the database.
Can anyone tell me the best way for an applet to
connect to a SQL database without editing the
client's policy file to give permission?
Any help with this matter would be much appreciated.
Thanks.The best way to communicate to the database from an applet is through a servlet. But if you seriously want anybody to decompile your applet code and really fry your db its upto you. I wouldnot communicate directly from an applet to a db its not worthwhile

Similar Messages

  • 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]>

  • Offline copy of SQL Database in Visual Studio Community Edition?

    I'm using an Azure Mobile Service and SQL database, and I'm interacting with it via Visual Studio Community Edition (12.0.31101.00 Update 4).
    I'm often offline, but want to work on and test the SQL code.  Is there a way to sync a local copy of the database to my pc so I can work with that to test my code?  I'm not necessarily looking to make changes to the database offline and syncing
    that back to the server, although that would be nice too.
    Thanks!

    Hello Scott,
    You could use SQL Data Sync to synchronize your local copy of the database with the Azure SQL database. The details are documented at http://msdn.microsoft.com/en-us/library/hh456371.aspx. 
    PS - the SQL Data Sync feature is still in preview and the support is only through forums.
    Regards,
    Kumar Bijayanta

  • How to access the sql database in applet?

    How to access the sql database in applet?
    Please help me.

    import java.applet.*;
    import java.awl.*;
    import java.sql.*;
    //other packages
    public class jdb extends Applet
    Connection con;
    Statement stmt;
    String name="drvijay";
    String phoneno="9842088860";
    public void init(){}
    pubilc void stop(){}
    public void destroy(){}
    public void start()
    call();
    public void call()
    try{
              Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
              conn=DriverManager.getConnection("Jdbc:Odbc:emp","sa","");
              stmt=conn.createStatement();
              stmt.executeUpdate("insert into empdetails(name,phoneno) values ('"+name + "',''"+ phoneno +"' )" );
              }catch(SQLException e)
                   System.out.println("error"+e);
                   System.exit(0);
    //<applet code="jdb" height="200" width="200"> </applet>
    u this jdbc statement in any of the method..
    */

  • Applet - Database communication thro' browser

    I want to know how to communicate applet with database using Internet Explorer Browser. We can communicate applet with database using appletviewer. But in IE it is showing "sun.jdbc.odbc.JdbcOdbcDriver not found" Exception. For that I took the sun.jdbc.odbc.JdbcOdbcDriver class from jdk, made it as a jar. I added the jar to the archive attribute of the applet tag. After that browser is showing suitable driver not found excption. How can I solve this problem? Please Help me.

    Hi,
    Microsoft changed the name of the JBDC driver.In order to get it
    to work for IE you will need to change the name of the driver to
    com.ms.jdbc.odbc.JdbcOdbcDriver.
    Alternatively, you can install the Java 2 plugin for your browser.
    HTML Converter will generate the .html to use the Java 2 plugin.
    See the following for more information about the HTML for using the Java 2 plugin:
    http://java.sun.com/products/plugin/index-1.4.html and
    http://java.sun.com/products/plugin/1.3/features.html
    Hope this helps.
    Good Luck.
    Gayam.Srinivasa Reddy
    Developer Technical Support
    Sun Microsystems
    http://www.sun.com/developers/support/

  • Advise on SQL database process

    Dear all,
    We have build our own product CMS platform configuration which is running on SQL server and CMS web site link to it.
    We will lauch our product soon but need to identify the correct hosting plan for not having any further issue.
    For exemple for now all is hosted in our company azure account with a Standard Basic 5 DTU's.
    When we go in production we can expect some connection and big amount of data on our database.
    My question are as follow :
    - Does using a single database storage for my potential Customers would be enough ?
    - How should I plan backup efficiently ?
    - Should I plan a safety replication process somewhere in azure or duplicate the storage in order to switch in case of lack of place ?
    My concern is to avoid my database beeing full while customers increase
    Thanks for your advise and help
    regards
    serge

    Hi Solatys,
    - If I select by default STANDARD Azure database, which size, DTU, etc should I select ? 
    For this question, you may reference the below link. You can scale your Azure database performance based on the real-time requirement.
    Azure
    SQL Database introduces new near real-time performance metrics 
    - If for instance the initial URL of the web portal connected to SQL server1 has a trouble, how can I switch users transparently to a second replicated server in order that user will notify anything ?
    Azure SQL Database has a built-in high availability subsystem that protects your database from failures of individual servers and devices in a datacenter. Azure SQL
    Database maintains multiple copies of all data in different physical nodes located across fully independent physical sub-systems to mitigate outages due to failures of individual server components, such as hard drives, network interface adapters, or even entire
    servers. At any one time, three database replicas are running—one primary replica and two or more
    secondary replicas. Data is written to the primary and one secondary replica using a quorum based commit scheme before the transaction is considered committed.
    If the hardware fails on the primary replica, Azure SQL Database detects the failure and fails over to the secondary replica. In case of a physical loss of a replica, a new replica is automatically created.
    So there are always at minimum two physical, transactionally consistent copies of your data in the datacenter.
    Azure SQL Database Business Continuity
    - IF I select the Maximum size of the database, what will happen in case it will be nearly full and need to provide more space ?
    Insert and update transactions that exceed the upper limit will be rejected because the database will be in read-only mode. The maximum size has been gained from 50GB to 500GB as of now, you may have no concern about it. You can
    set a monitoring alertto
    notify the storage utilization and CPU percentage etc.
    If you have any question, feel free to let me know.
    Eric Zhang
    TechNet Community Support

  • Merge to Insert or update records in SQL Database

    Hello ,
    I am having hard time with creating a Stored Procedure to insert/update the selected records from Oracle data base to SQL database using BizTalk.
    ALTER PROCEDURE [dbo].[uspInsertorUpdateINF]
    @dp_id char(32),
    @dv_id char(32),
    @em_number char(12),
    @email varchar(50),
    @emergency_relation char(32),
    @option1 char(16),
    @status char(20),
    @em_id char(35),
    @em_title varchar(64),
    @date_hired datetime
    AS
    BEGIN
    SET NOCOUNT ON;
    MERGE [dbo].[em] AS [Targ]
    USING (VALUES (@dp_id, @dv_id , @em_number, @email, @emergency_relation, @option1, @status, @em_id, @em_title, @date_hired))
    AS [Sourc] (dp_id, dv_id, em_number, email, emergency_relation, option1, status, em_id, em_title, date_hired)
    ON [Targ].em_id = [Sourc].em_id
    WHEN MATCHED THEN
    UPDATE SET dp_id = [Sourc].dp_id,
    dv_id = [Sourc].dv_id,
    em_number = [Sourc].em_number,
    email = [Sourc].email,
    emergency_relation = [Sourc].emergency_relation,
    option1 = [Sourc].option1,
    status = [Sourc].status,
    em_title = [Sourc].em_title,
    date_hired = [Sourc].date_hired
    WHEN NOT MATCHED BY TARGET THEN
    INSERT (dp_id, dv_id, em_number, email, emergency_relation, option1, status, em_id, em_title,date_hired)
    VALUES ([Sourc].dp_id, [Sourc].dv_id, [Sourc].em_number, [Sourc].email, [Sourc].emergency_relation, [Sourc].option1, [Sourc].status, [Sourc].em_id, [Sourc].em_title, [Sourc].date_hired);
    END;
    I am getting an error like
    WcfSendPort_SqlAdapterBinding_
    TypedProcedures_dbo_Custom" with URL "mssql://abc//def?". It will be retransmitted after the retry interval specified for this Send Port. Details:"System.Data.SqlClient.SqlException (0x80131904): Procedure or function 'uspInsertorUpdateINF'
    expects parameter '@dp_id', which was not supplied
    I cannot give the Oracle Database name directly in the stored Procedure
    I am stuck with this, and cannot figure out since I am new to SQL Queries and Stored Procedures. Any help is greatly appreciated.
    Thanks

    Hi sid_siv,
    Only the first record is inserted because of the scalar variables of the stored procedure(SP), when you call the SP, only one row is passed. To get all rows inserted, you can either declare a
    table-valued parameter
    (TVP) for the SP or using an Oracle linked server in the SP.
    Create a stored procedure with a table-valued parameter
    As you mentioned linked server is not good in your case, then TVP SP can be the only option. Regarding how to call a SP with TVP parameter in BizTalk, that's a typically BizTalk question then. I would suggest you post your question in a dedicated
    BizTalk Server forum. It is more appropriate and more experts will assist you.
    If you have any question, feel free to let me know.
    Eric Zhang
    TechNet Community Support

  • Database Initialiser does not create azure sql database

    I have a WPF application In the OnStartup in the app.cs I set the Database initializer and forced the context the initialise my database:
    Debug.WriteLine("Setting Initializer");
    Database.SetInitializer<MyContext>(new MyDatabaseInitializer());
    Debug.WriteLine("Declaring new context");
    using (MyContext c = new MyContext("MyContext"))
    Debug.WriteLine("Force the initialization");
    c.Database.Initialize(true);
    Debug.WriteLine("Done!");
    I created a sql database in the management portal of the azure.
    Copied the connectionstring it provided for ADO.net.
    But my database is not created.
    I also added a firewall rule but nothing happens. I Have no clue what to do.
    Can anybody please help me with this?
    If you need more information please ask i really have to get this sorted out.
    Thanks in advance!

    Hi Turkstra,
    I have tried to use EF to create Azure SQL database, it works as expect, the database 'jambordbcreate' appear in my SQL Azure, below is the detailed codes.
    using System;
    using System.Collections.Generic;
    using System.Data.Entity;
    using System.Linq;
    using System.Text;
    using System.Threading.Tasks;
    namespace CodeFirst
    class Program
    static void Main(string[] args)
    Database.SetInitializer(
    new CreateDatabaseIfNotExists<SchContext>());
    using (var db = new SchContext("Server=tcp:****.database.windows.net,1433;Database=jambordbcreate;User ID=vote@***;Password=***;Trusted_Connection=False;Encrypt=True;Connection Timeout=30"))
    string name = "jambor";
    var student=new Student(){Name=name, ID="1a"};
    db.Students.Add(student);
    db.SaveChanges();
    db.Database.Initialize(true);
    public class Student
    public string ID { get; set; }
    public string Name { get; set; }
    public string age { get; set; }
    public string sex { get; set; }
    public class School
    public string ID { get; set; }
    public string Name { get; set; }
    public virtual List<Student> Students { get; set; }
    public class SchContext : DbContext
    public SchContext(string connection):base(connection)
    public DbSet<Student> Students { get; set; }
    public DbSet<School> Schools { get; set; }
    I suggest  you check your SQL connection, after run your code, please refresh azure portal to see whether your database is exist. Hope this give you some help.
    Best Regards,
    Jambor
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Which is better for performance Azure SQL Database or SQL Server in Azure VM?

    Hi,
    We are building an ASP.NET app that will be running on Microsoft Cloud which I think is the new name for Windows Azure. We're expecting this app to have many simultaneous users and want to make sure that we provide excellent performance to end users.
    Here are our main concerns/desires:
    Performance is paramount. Fast response times are very very important
    We want to have as little to do with platform maintenance as possible e.g. managing OS or SQL Server updates, etc.
    We are trying to use "out-of-the-box" standard features.
    With that said, which option would give us the best possible database performance: a SQL Server instance running in a VM on Azure or SQL Server Database as a fully managed service?
    Thanks, Sam

    hello,
    SQL Database using shared resources on the Microsft data centre. Microsoft balance the resource usage of SQL Database so that no one application continuously dominates any resource.You can try the 
    Premium Preview
    for Windows Azure SQL Database which offers better performance by guaranteeing a fixed amount of dedicated resources for a database.
    If you using SQL Server instance running in a VM, you control the operating system and database configuration. And the
    performance of the database depends on many factors such as the size of a virtual machine, and the configuration of the data disks.
    Reference:
    Choosing between SQL Server in Windows Azure VM & Windows Azure SQL Database
    Regards,
    Fanny Liu
    If you have any feedback on our support, please click here. 
    Fanny Liu
    TechNet Community Support

  • How to move SQL database from one location to another location i.e. from C' drive to D' drive

    Hi, How to move SQL database from one location to another location i.e. from C' drive to D' drive ? please share some link.
    Thanks and Regards, Rangnath Mali

    Hi Rangnath,
    According to your description, my understanding is that you want to move databased from C drive to D drive.
    You can detach Database so that the files become independent, cut and paste the files from source to destination and attach again.
    There are two similar posts for your reference:
    http://mssqltalks.wordpress.com/2013/02/28/how-to-move-database-files-from-one-drive-to-another-or-from-one-location-to-another-in-sql-server/
    http://stackoverflow.com/questions/6584938/move-sql-server-2008-database-files-to-a-new-folder-location
    Best Regards,
    Wendy
    Wendy Li
    TechNet Community Support

  • How to show image in a datagridview cell called from a URL stored in an SQL database

    I am using Visual Studio 2008 creating a Windows Form to display a datagrid with real estate information. The SQL database record contains a dozen fields of text which I have no problem displaying. My problem is one of the columns contains
    a url which links to a picture on a remote third party server. I need to display a thumb nail picture on the grid row based on the stored url. When I edit the gridview column I see there is a "column type" setting and
    in the dropdown is DataGridViewImageColumn. I don't see any URL setting where I can bind the sql field to. 
    Any help would be greatly appreciated.

    Hi ikeni,
    I think you could do as below:
    1.Set the ColumnType as “DataGridViewImageColumn”
    2.For each row of the datagridview, and set the Value of datagridview cells like  “dataGridView1[2, 0].Value = Image.FromFile(@"\\1.168.1.1\C$\Users\Desktop\3.JPG")”
    You could turn to the links below for more information:
    setting an Image column in a datagrid view based on a value in the database c#
    https://social.msdn.microsoft.com/Forums/windows/en-US/62f5b477-5311-4de5-bc18-fbd29bbfc9e2/setting-an-image-column-in-a-datagrid-view-based-on-a-value-in-the-database-c?forum=winformsdatacontrols
    Check if file exists on remote server and various drive
    http://stackoverflow.com/questions/26432688/check-if-file-exists-on-remote-server-and-various-drive
    If you have any further questions, please feel free to post in this forum.
    Best Regards,
    Edward
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

  • Connecting to SQL database via an application deployed in Tomcat

    Hi,
    When the SQL database is restarted, the connection of the web application gets lost and the tomcat has to be restarted manually in order to reset connection with the database. Please let me know if there is a way by which the connection can be re-establised without manually restarting the tomcat.
    Thanks and regards
    Lipi

    Hi Arut,
    Below is the paragraph that is extracted from the
    book:
    “When connecting to a SQL Server database you cannot use Windows authentication or the SharePoint Server single sign-on service, named Secure Store Service(SSS). You are limited to using a SQL Server authentication user name and password, which are sent
    over the network in plain text.”
    So Windows authentication users are not supported to connect to SQL Server databases in SharePoint Designer.
    As the error still occurs when you connect to SQL server with SQL server authentication users, I recommend to check if the SQL Server authentication method is set to be SQL Server and Windows Authentication mode and please make sure that the account has
    permission to access SQL Server databases.
    Best regards,
    Victoria
    TechNet Community Support
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact
    [email protected]

  • 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

  • Insufficient SQL database permissions for user 'Name: NT AUTHORITY\IUSR SID: S-1-5-17...

    Hi,
    I have a customized SharePoint page that takes user input data, validate some of the data, then writes the data to a SharePoint list. If an exception occurs, it will write the error to the ULS.
    All was working well in the test environments.
    However, recently we noticed that in the QA environment, when it's trying to write to ULS, it causes another issue:
    Insufficient SQL database permissions for user 'Name: NT AUTHORITY\IUSR SID: S-1-5-17 ImpersonationLevel: Impersonation' in database 'SP_F1_Config' on SQL Server instance 'SQL01'. Additional error information from SQL Server is included below. The EXECUTE
    permission was denied on the object 'proc_putObjectTVP', database 'SP_F1_Config', schema 'dbo'.
    I've traced through the code and found that it fails on the line:
        SPDiagnosticsServiceBase.GetLocal<LoggerError>();
    where LoggerError is the logger class inheritng SPDiagnosticsServiceBase
    I have also googled around today, but the most positive solution provided
    on this page was to manually modify SQL object permission, which I believe we should not do, and would not be supported by Microsoft.
    So the questions are:
    Why is AUTHORITY\IUSER used for SPDiagnosticsServiceBase.GetLocal()? Should that account actually be allowed to access SharePoint databases? (This is an intranet environment and using claim based/Windows authentication, no no anonymous access would be allowed
    anyway).
    I've checked the Application Pool account permissions in SQL, comparing the environment that works and the one that doesn't work, and the permissions/roles/schemas look identical on server and database level. Where else can I check?
    On the environment that works, I logged on as SharePoint administrator, created a new SharePoint Visual Web Part solution in Visual Studio, just to test writing to ULS. Then I press F5 in Visual Studio to debug it. It also has the same problem.
    It just seems like somehow the user's identity (or whatever the identity SharePoint required) was not passed to SPDiagnosticsServiceBase.
    Any suggestions, or even better, solutions would be really really much appreciated!

    Hi,
    Thanks for your sharing, it will be userful to the people who stuck with the same issue.
    Best regards
    Patrick Liang
    TechNet Community Support

  • How to create a setup for window form application including the related sql database?

    i have created a simple window form application project that have only 2 form..
    1st one for login in which it'll check the userid n password from database.if both are correct then it will go to 2nd form.
    now i want this project to run in another computer.
    i created a setup file but its showing some error regarding the database instances connection..
    so if anyone can tell me in details how to create the setup file then it'll b a great help..
    thanx in advance..

    Hi,
    Consider the above scenario,I suggest you to use the SQL Server Compact+ ClickOnce Deployment, A Compact SQL database is a file that can be bundled with your application installation. Below is a link guiding you through the creation process of a SQL Compact
    database.
    http://technet.microsoft.com/en-us/library/ms173009.aspx
    The following link discusses setting up the necessary dependencies and prerequisites for SQL Server Compact. (Note, you will need to scroll to the section entitled Private File–Based Deployment.)
    http://msdn.microsoft.com/en-us/library/aa983326(v=VS.100).aspx
    A ClickOnce Deployment can help you publish your application attach compact SQL database into client machine.
    Regards,
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

Maybe you are looking for