TCP/IP connexion failed in csharp smart device
-
No, that's another exception. It happens because your try block never executed succesfully. put a breakpoint at MessageBox.Show(ex.Message); and look at the value of ex then (with the debugger)
Hi Michel, The same appears as i wrote last time,same exception expression thanks
-
Hi Michel, My emulator is not cradling.When googling,I found this link talking about how to cradle an emulator:http://netcf2.blogspot.com/2005/11/getting-started-using-emulator.html[^] I wanna ask should I use a real PDA?is the emulator enough? Thanks
You should cradle it. cradling will give the emulator an IP address. In mobile device center, be sure to select 'DMA' in connection settings. Then do the internet explorer test again.
-
You should cradle it. cradling will give the emulator an IP address. In mobile device center, be sure to select 'DMA' in connection settings. Then do the internet explorer test again.
Hi Michel, Sorry for yesterday,I couldn't continue with u because the time work finished and I have no Internet connexion in home.When trying to cradle my emulator,the first step I found is to enable TCP/IP connexion in the emulator.This required to install Virtual PC 2007but got this error while installing:
Error 1335. The cabinet file 'product.cab' required for this installation is
corrupt and cannot be used..."I tried redownloading VPC and even saving to different disk and still get same error. Any ideas? thanks
-
Tunisien86 wrote:
In fact,my combobox should contain the result of my select statement,but when running,the system is show an sqlexception and nothing is added to my combobox.
It's easier to find a problem if you include the message of the exception. In this case it's probably caused by a common error - your tablenames contain illegal characters. You can "fix" it with brackets;
string sSQL = "SELECT DISTINCT * FROM [D°_urgence]";
Also note that the change in code assumes that your select-statement is run against an SQL Server instance, one that has access to the *.mdf-file that you want to read from. If this data is stored locally, in an *.sdf file, then you'd indeed need the
SqlCe
-classes.Tunisien86 wrote:
Or should I take the physical @ as the @ of my computer?
Ideally, you take the computers' name and the instance name and put it in a configurationfile. Something like "Admin-PC/MySql2005Instance". There might be lots of IP-adresses on a computer, but it usually only has a single name that identifies it in the network. It also communicates easier, imagine yelling "Reboot Skynet and Idefix" in contract to "Reboot One-Nine-Two Doht One-Six-Eight Doht One Doht Zero.. - No Four, I meant Four!" :cool:
I are Troll :suss:
hI Eddy, when trying to cradle my emulator,I can't install the virtual PC 2007 and getting this error:
Error 1335. The cabinet file 'product.cab' required for this installation is
corrupt and cannot be used..."What can i do?
-
hI Eddy, when trying to cradle my emulator,I can't install the virtual PC 2007 and getting this error:
Error 1335. The cabinet file 'product.cab' required for this installation is
corrupt and cannot be used..."What can i do?
-
Goodmorning :) Redownload Virtual PC and reinstall it, looks like your setup is corrupt. How is the Sql-query going?
I are Troll :suss:
Hi, I redowload VPC2007 and install it but still the same error.The sql query goes fine.Tha problem is now in the cradling of the emulator. Thanks
-
Goodmorning :) Redownload Virtual PC and reinstall it, looks like your setup is corrupt. How is the Sql-query going?
I are Troll :suss:
Hi Thanks I cradled my emulator.The Emulator must be running to be able to cradle it. When should I uncradle my emulator??? When trying to install windows mobile device center,it failed.Should i connect a real device to be able to install this tool??? How can I get the IP number that is used for my device and PC for this TCP/IP connection?????? Thanks a lot for u clarification Marwen Smile
-
Hi Thanks I cradled my emulator.The Emulator must be running to be able to cradle it. When should I uncradle my emulator??? When trying to install windows mobile device center,it failed.Should i connect a real device to be able to install this tool??? How can I get the IP number that is used for my device and PC for this TCP/IP connection?????? Thanks a lot for u clarification Marwen Smile
Tunisien86 wrote:
When should I uncradle my emulator???
That's out of my league; cradling the iPaq was a matter of inserting the USB-cable, never tried it on the emulator.
Tunisien86 wrote:
When trying to install windows mobile device center,it failed.Should i connect a real device to be able to install this tool???
That might be possible; some applications require the real thing and won't work with the emulator.
Tunisien86 wrote:
How can I get the IP number that is used for my device and PC for this TCP/IP connection??????
The IP-adress of the mobile device can be retrieved using this[^] snippet (scroll to the end), the IP-adress of Sql Server should be already known.
I are Troll :suss:
-
You should cradle it. cradling will give the emulator an IP address. In mobile device center, be sure to select 'DMA' in connection settings. Then do the internet explorer test again.
Hi Freinds, Finally I depass the problem of the connexion to server by the DB File's attachment :laugh: . No exception apperas.Still now the problem of the filling of my combobox .I try with sqldataset instead of the sqlreader like this:
string sConnection = "Data Source=127.0.0.1,1433;Persist Security Info=True;Initial Catalog=GMAO;User ID=sa;Password=sa";
string sSQL = "SELECT com FROM energie; ";
SqlConnection conn = new SqlConnection(sConnection);
SqlCommand comm = new SqlCommand(sSQL, conn);
DataSet ds = new DataSet();
SqlCeDataAdapter da = new SqlCeDataAdapter();
SqlDataReader dr = null;
try
{comm.Connection.Open(); da.Fill(ds, "SQL Temp Table"); foreach(DataRow d in ds.Tables\[0\].Rows) comboBox1.Items.Add(d.ToString());
}
catch (SqlException ex)
{
//MessageBox.Show("connexion impossible");
MessageBox.Show(ex.Message);
return;
}dr.Close();
comm.Connection.Close();
}but nothing is added to my combobox. Thanks in all cases for u collaboration I am really sooooooooooo happy :laugh:
-
Hi, I develop a GMAO csharp smart device application.I try now to connect to my remote database.mdf using TCP/IP protocol.I created a combobox where i want to extract informations from my table using this select statement:
"SELECT DISTINCT NObt FROM 4BT ";
.For my IPadreess of my computer,I use the ipconfig/all command and I take the
IPv4 Address. . . . . . . . . . . : 192.168.1.4(Preferred)
My hole code is like this:
using System;
using System.Linq;
using System.Data.SqlServerCe;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Data.SqlClient;
using System.Drawing;
using System.Text;
using System.Windows.Forms;namespace ModeDifféré
{
public partial class Form6 : Form
{
public Form6()
{
InitializeComponent();
}private void comboBox1\_SelectedIndexChanged(object sender, EventArgs e) { } private void Form6\_Load(object sender, EventArgs e) { string sConnection = "Data Source=192.168.1.4,1433;Initial Catalog=GMAO;User ID=sa;Password=sa;"; string sSQL = "SELECT DISTINCT NObt FROM 4BT"; SqlCeCommand comm = new SqlCeCommand(sSQL, new SqlCeConnection(sConnection)); SqlCeDataReader dr = null; try { comm.Connection.Open(); dr = comm.ExecuteReader(); while (dr.Read()) comboBox1.Items.Add(dr\[0\]); } catch (Exception ex) { MessageBox.Show(ex.Message); return; } dr.Close(); comm.Connection.Close(); } }
}
When running,this error appears:
Unknown connection option in connection string: initial catalog.
As an information,I follow the steps of this link:http://netcf2.blogspot.com/2005/12/accessing-sql-server-express-from.html[^] What is the problem??? Thank u for all u suggestion Regards Marwen :)
Hi guys, I depass the problem :laugh: finally of the connection to the server due to the DATABASE FILE's ATTACHMENT. Still now the problem in the filling of my combobox.In fact,no exception appears so connection to server works well.In other hand,nothing is added to my combobox. I try to replace my sqldatareader by sqldataset but still the same thing:
private void Form6_Load(object sender, EventArgs e)
{string sConnection = "Data Source=127.0.0.1,1433;Persist Security Info=True;Initial Catalog=GMAO;User ID=sa;Password=sa"; string sSQL = "SELECT com FROM energie; "; SqlConnection conn = new SqlConnection(sConnection); SqlCommand comm = new SqlCommand(sSQL, conn); DataSet ds = new DataSet(); SqlDataAdapter da = new SqlDataAdapter(); SqlDataReader dr = null; try { comm.Connection.Open(); da.Fill(ds, "SQL Temp Table"); foreach(DataRow d in ds.Tables\[0\].Rows) comboBox1.Items.Add(d.ToString()); } catch (SqlException ex) { //MessageBox.Show("connexion impossible"); MessageBox.Show(ex.Message); return; } dr.Close(); comm.Connection.Close(); }
How do I depass that??? Thank u in all cases I am really sooooooo happy :laugh: