Re: Trouble connecting to SQL Server 2000 from Windows Mobile device

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Never mind...I got it to work. I had to create a new user on the SQLServer
with standard authorization (non-trusted).

David

David C wrote:
>I am having trouble connecting to a SQL Server 2000 server on our network.
>The device is connected wirelessly to the network. I can ping the IP address
>of our SQL Server from the mobile device. I can get on the internet using the
>device. But I get an SQLException when trying to run just a very simple app
>that is suppose to connect to the SQL Server Northwind database. Here is my
>simple app. The app is suppose to just pull one record and show the record
>count in a text box on a form but never gets to that point. It bombs on the
>connection. Could someone tell me if my connection string is off or something?
>
>Thanks,
>David
>
>using System;
>using System.Drawing;
>using System.Collections;
>using System.Windows.Forms;
>using System.Data;
>using System.Data.Common;
>using System.Data.SqlClient;
>
>namespace TestSQL
>{
> /// <summary>
> /// Summary description for Form1.
> /// </summary>
> public class Form1 : System.Windows.Forms.Form
> {
> private System.Windows.Forms.TextBox textBox1;
> private System.Windows.Forms.TextBox textBox2;
> private System.Windows.Forms.MainMenu mainMenu1;
>
> public Form1()
> {
> //
> // Required for Windows Form Designer support
> //
> InitializeComponent();
>
> //
> // TODO: Add any constructor code after InitializeComponent call
> //
> }
> /// <summary>
> /// Clean up any resources being used.
> /// </summary>
> protected override void Dispose( bool disposing )
> {
> base.Dispose( disposing );
> }
> #region Windows Form Designer generated code
> /// <summary>
> /// Required method for Designer support - do not modify
> /// the contents of this method with the code editor.
> /// </summary>
> private void InitializeComponent()
> {
> this.mainMenu1 = new System.Windows.Forms.MainMenu();
> this.textBox1 = new System.Windows.Forms.TextBox();
> this.textBox2 = new System.Windows.Forms.TextBox();
> //
> // textBox1
> //
> this.textBox1.Location = new System.Drawing.Point(32, 40);
> this.textBox1.Size = new System.Drawing.Size(184, 22);
> this.textBox1.Text = "textBox1";
> //
> // textBox2
> //
> this.textBox2.Location = new System.Drawing.Point(32, 88);
> this.textBox2.Size = new System.Drawing.Size(184, 22);
> this.textBox2.Text = "textBox2";
> //
> // Form1
> //
> this.Controls.Add(this.textBox2);
> this.Controls.Add(this.textBox1);
> this.Menu = this.mainMenu1;
> this.Text = "Form1";
> this.Load += new System.EventHandler(this.Form1_Load);
>
> }
> #endregion
>
> /// <summary>
> /// The main entry point for the application.
> /// </summary>
>
> static void Main()
> {
> Application.Run(new Form1());
> }
>
> private void Form1_Load(object sender, System.EventArgs e)
> {
> // Connection String for MSSQL Server 200
> // Server IP 192.168.251.32, dummy database = WINSTSDB, dummy user =
>sleeptrain
> string Connection_String = "Data Source=192.168.251.32;Initial
>Catalog=Northwind;User Id=sleeptrain;Password=monkeytrain";
> // Setup SQL Connection object
> SqlConnection dbConn = new SqlConnection( Connection_String );
>
> // This routine will create a detailed table structure report
> SqlDataAdapter da = new SqlDataAdapter("SELECT * FROM dbo.Employees WHERE
>EmployeeID = 1",dbConn);
>
> // Define a Data Table object
> System.Data.DataTable WinstisTable = new DataTable();
>
>
> dbConn.Open();
> da.Fill( WinstisTable );
>
> this.textBox1.Text = "Count = " + WinstisTable.Rows.Count.ToString();
>
> dbConn.Close();
> da.Dispose();
>
> }
> }
>}

--
Message posted via SQLMonster.com
http://www.sqlmonster.com/Uwe/Forums.aspx/sql-server-ce/200511/1
.



Relevant Pages

  • Re: General Network Error
    ... connection, but you are not properly prepared to reopen a connection when ... retrieves data from a Sql Server 2000 instance, manipulates that data, ... The app works fine on the emulator during development. ... "General Network error. ...
    (microsoft.public.dotnet.framework.compactframework)
  • Re: Bizzare SQL Network Error
    ... The bizzare thing is that, the same connection string, the same code to ... In a windows APP it works fine, in a Web APP I get ... >>I am trying to connect to a default instance of SQL Server 2000 Enterprise ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: Losing connections with SQL 2005
    ... Hitchhiker's Guide to Visual Studio and SQL Server ... SQL Server automatically detects if the client falls into the sea or gets ... Does the Connection pooling mechanism do this on its ... Upgrading our app is a really big task, ...
    (microsoft.public.sqlserver.connect)
  • Re: MS-Access front-ends lose connection to SQL cluster after fail
    ... the MSDN website and will forward that to our DB admins. ... more combersome than if you use ADO Code to connect to SQL Server. ... >> to detect a lost connection and be able to reconnect. ... The app does not have to know anything about a failover ...
    (microsoft.public.sqlserver.clustering)
  • Re: ADO.NET 2.0 & MSDE & Win98
    ... See my blog for a connection checklist. ... The MSDE will ... be installed on Win98 as the SQL Server to which the app will connect. ...
    (microsoft.public.dotnet.framework.adonet)