Click here to Skip to main content
15,908,909 members
Home / Discussions / C#
   

C#

 
AnswerRe: Display List items? Pin
Henry Minute5-May-10 1:15
Henry Minute5-May-10 1:15 
AnswerRe: Display List items? Pin
Peace ON5-May-10 2:01
Peace ON5-May-10 2:01 
AnswerRe: Display List items? Pin
Luc Pattyn5-May-10 2:52
sitebuilderLuc Pattyn5-May-10 2:52 
QuestionTCP/IP connexion failed in csharp smart device Pin
Tunisien865-May-10 0:58
Tunisien865-May-10 0:58 
AnswerRe: TCP/IP connexion failed in csharp smart device Pin
Eddy Vluggen5-May-10 1:03
professionalEddy Vluggen5-May-10 1:03 
GeneralRe: TCP/IP connexion failed in csharp smart device Pin
Tunisien865-May-10 1:10
Tunisien865-May-10 1:10 
GeneralRe: TCP/IP connexion failed in csharp smart device Pin
Eddy Vluggen5-May-10 1:22
professionalEddy Vluggen5-May-10 1:22 
GeneralRe: TCP/IP connexion failed in csharp smart device Pin
Tunisien865-May-10 2:25
Tunisien865-May-10 2:25 
Hi Eddy,
Thanks a lot for u collaboration Smile | :) .I understand u meaning.I make changement but still not working.
My new code is like that:
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 * FROM D°_urgence";
            SqlCommand comm = new SqlCommand(sSQL, new SqlConnection(sConnection));
            SqlDataReader 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();
        }
    }
}

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.
Is the IPadress the problem?the ipconfig command returns to me this:
 C:\Users\Admin>ipconfig /all

Windows IP Configuration

   Host Name . . . . . . . . . . . . : Admin-PC
   Primary Dns Suffix  . . . . . . . :
   Node Type . . . . . . . . . . . . : Hybrid
   IP Routing Enabled. . . . . . . . : No
   WINS Proxy Enabled. . . . . . . . : No

Wireless LAN adapter Wireless Network Connection 2:

   Media State . . . . . . . . . . . : Media disconnected
   Connection-specific DNS Suffix  . :
   Description . . . . . . . . . . . : Microsoft Virtual WiFi Miniport Adapter
   Physical Address. . . . . . . . . : 06-1B-9E-4A-A0-8C
   DHCP Enabled. . . . . . . . . . . : Yes
   Autoconfiguration Enabled . . . . : Yes

Wireless LAN adapter Wireless Network Connection:

   Connection-specific DNS Suffix  . :
   Description . . . . . . . . . . . : Atheros AR5007EG Wireless Network Adapter

   Physical Address. . . . . . . . . : 00-1B-9E-4A-A0-8C
   DHCP Enabled. . . . . . . . . . . : Yes
   Autoconfiguration Enabled . . . . : Yes
   Link-local IPv6 Address . . . . . : fe80::cc28:8ea3:82ea:4c4f%13(Preferred)
   IPv4 Address. . . . . . . . . . . : 192.168.1.4(Preferred)
   Subnet Mask . . . . . . . . . . . : 255.255.255.0
   Lease Obtained. . . . . . . . . . : mercredi 5 mai 2010 10:08:26
   Lease Expires . . . . . . . . . . : jeudi 6 mai 2010 10:08:25
   Default Gateway . . . . . . . . . : 192.168.1.1
   DHCP Server . . . . . . . . . . . : 192.168.1.1
   DHCPv6 IAID . . . . . . . . . . . : 234888094
   DHCPv6 Client DUID. . . . . . . . : 00-01-00-01-13-55-22-65-00-1A-92-FC-E6-7E

   DNS Servers . . . . . . . . . . . : 192.168.1.1
                                       192.168.1.1
   NetBIOS over Tcpip. . . . . . . . : Enabled

Ethernet adapter Local Area Connection:

   Media State . . . . . . . . . . . : Media disconnected
   Connection-specific DNS Suffix  . : home
   Description . . . . . . . . . . . : Realtek RTL8139/810x Family Fast Ethernet
 NIC
   Physical Address. . . . . . . . . : 00-1A-92-FC-E6-7E
   DHCP Enabled. . . . . . . . . . . : Yes
   Autoconfiguration Enabled . . . . : Yes

Tunnel adapter isatap.home:

   Media State . . . . . . . . . . . : Media disconnected
   Connection-specific DNS Suffix  . :
   Description . . . . . . . . . . . : Microsoft ISATAP Adapter
   Physical Address. . . . . . . . . : 00-00-00-00-00-00-00-E0
   DHCP Enabled. . . . . . . . . . . : No
   Autoconfiguration Enabled . . . . : Yes

Tunnel adapter Local Area Connection* 11:

   Connection-specific DNS Suffix  . :
   Description . . . . . . . . . . . : Microsoft Teredo Tunneling Adapter
   Physical Address. . . . . . . . . : 00-00-00-00-00-00-00-E0
   DHCP Enabled. . . . . . . . . . . : No
   Autoconfiguration Enabled . . . . : Yes
   IPv6 Address. . . . . . . . . . . : 2001:0:4137:9e74:454:bc2:3f57:fefb(Prefer
red)
   Link-local IPv6 Address . . . . . : fe80::454:bc2:3f57:fefb%11(Preferred)
   Default Gateway . . . . . . . . . : ::
   NetBIOS over Tcpip. . . . . . . . : Disabled

Tunnel adapter isatap.{9CD32A2C-C6BD-42FC-9F45-933E12729451}:

   Media State . . . . . . . . . . . : Media disconnected
   Connection-specific DNS Suffix  . :
   Description . . . . . . . . . . . : Microsoft ISATAP Adapter #2
   Physical Address. . . . . . . . . : 00-00-00-00-00-00-00-E0
   DHCP Enabled. . . . . . . . . . . : No
   Autoconfiguration Enabled . . . . : Yes

Tunnel adapter isatap.{13CC6962-1531-4DD0-BC0C-47DEA185DF81}:

   Media State . . . . . . . . . . . : Media disconnected
   Connection-specific DNS Suffix  . :
   Description . . . . . . . . . . . : Microsoft ISATAP Adapter #3
   Physical Address. . . . . . . . . : 00-00-00-00-00-00-00-E0
   DHCP Enabled. . . . . . . . . . . : No
   Autoconfiguration Enabled . . . . : Yes

.

I took the
IPv4 Address. . . . . . . . . . . : 192.168.1.4(Preferred)

Or should I take the physical @ as the @ of my computer?
I really i don't understand the problem.
Thanks
D'Oh! | :doh:
GeneralRe: TCP/IP connexion failed in csharp smart device Pin
Tunisien865-May-10 2:52
Tunisien865-May-10 2:52 
GeneralRe: TCP/IP connexion failed in csharp smart device Pin
Michel Godfroid5-May-10 4:04
Michel Godfroid5-May-10 4:04 
GeneralRe: TCP/IP connexion failed in csharp smart device Pin
Tunisien865-May-10 4:22
Tunisien865-May-10 4:22 
GeneralRe: TCP/IP connexion failed in csharp smart device Pin
Michel Godfroid5-May-10 4:47
Michel Godfroid5-May-10 4:47 
GeneralRe: TCP/IP connexion failed in csharp smart device Pin
Tunisien865-May-10 5:24
Tunisien865-May-10 5:24 
GeneralRe: TCP/IP connexion failed in csharp smart device Pin
Michel Godfroid5-May-10 5:52
Michel Godfroid5-May-10 5:52 
GeneralRe: TCP/IP connexion failed in csharp smart device Pin
Tunisien866-May-10 1:43
Tunisien866-May-10 1:43 
AnswerRe: TCP/IP connexion failed in csharp smart device Pin
Tunisien8611-May-10 6:03
Tunisien8611-May-10 6:03 
GeneralRe: TCP/IP connexion failed in csharp smart device Pin
Eddy Vluggen5-May-10 4:24
professionalEddy Vluggen5-May-10 4:24 
GeneralRe: TCP/IP connexion failed in csharp smart device Pin
Tunisien865-May-10 4:49
Tunisien865-May-10 4:49 
GeneralRe: TCP/IP connexion failed in csharp smart device Pin
Tunisien866-May-10 2:17
Tunisien866-May-10 2:17 
GeneralRe: TCP/IP connexion failed in csharp smart device Pin
Eddy Vluggen6-May-10 2:29
professionalEddy Vluggen6-May-10 2:29 
GeneralRe: TCP/IP connexion failed in csharp smart device Pin
Tunisien866-May-10 3:40
Tunisien866-May-10 3:40 
GeneralRe: TCP/IP connexion failed in csharp smart device Pin
Tunisien866-May-10 4:58
Tunisien866-May-10 4:58 
GeneralRe: TCP/IP connexion failed in csharp smart device Pin
Eddy Vluggen6-May-10 5:30
professionalEddy Vluggen6-May-10 5:30 
AnswerRe: TCP/IP connexion failed in csharp smart device Pin
Luc Pattyn5-May-10 2:57
sitebuilderLuc Pattyn5-May-10 2:57 
GeneralRe: TCP/IP connexion failed in csharp smart device Pin
Tunisien865-May-10 3:22
Tunisien865-May-10 3:22 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.