2011-10-04 24 views
0

我有一个带有SQL压缩数据库的Windows窗体应用程序。它运行在许多Windows PC上。客户端电脑采用德语。它总是返回SQL连接功能的错误,如添加,删除等。客户端的Windows窗体应用程序错误只能在我的机器上正确执行

语言差异可能是原因吗?

.....

更多相关信息......

我检查了这一切这是由于日期的差异,因为我的是2011年1月11日,在那是2011-11 -11也时间格式和固定的...

但现在另一个错误,我不明白为什么在我的电脑,我创建安装程序,然后安装它,我不会面对这个错误?

 The error was in german so i translated it and pasting below: 



information on invoking just-in debugging 
instead of this dialog box you will find at the end of this release. 

************** Exception Text ************** 
System.NullReferenceException: Object reference not set to an object instance. 
    at HotelReservationSystem.MyAppartments.DrawPricePeriods (Graphics g) in D: \ ERDDESKTOPPAPP \ New 834th 
    (Object sender, PaintEventArgs e) at HotelReservationSystem.MyAppartments.panelAppartments_Paint in D: \ ERDDESKTOPPAPP \ New 332nd 
    at System.Windows.Forms.Control.PaintWithErrorHandling (PaintEventArgs e, Int16 layer) 
    at System.Windows.Forms.Control.WmPaint (Message & m) 
    at System.Windows.Forms.Control.WndProc (Message & m) 
    (IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam) at System.Windows.Forms.NativeWindow.Callback 


************** Loaded Assemblies ************** 
mscorlib 
    Assembly Version: 4.0.0.0. 
    Win32 Version: 4.0.30319.239 (RTMGDR.030319-2300). 
    CodeBase: file:///C:/Windows/Microsoft.NET/Framework64/v4.0.30319/mscorlib.dll. 
---------------------------------------- 
hotel reservation system 
    Assembly Version: 1.0.0.0. 
    Win32 Version: 1.0.0.0. 
    CodeBase: file:///C:/Program% 20file% 20 (x86)/Microsoft/hotel setup/bin/Release/HotelReservationSystem.exe. 
---------------------------------------- 
System.Windows.Forms 
    Assembly Version: 4.0.0.0. 
    Win32 Version: 4.0.30319.235 built by: RTMGDR. 
    codebase: 
---------------------------------------- 
System.Drawing 
    Assembly Version: 4.0.0.0. 
    Win32 Version: 4.0.30319.1 built by: RTMRel. 
    codebase: 
---------------------------------------- 
System 
    Assembly Version: 4.0.0.0. 
    Win32 Version: 4.0.30319.236 built by: RTMGDR. 
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System/v4.0_4.0.0.0__b77a5c561934e089/System.dll. 
---------------------------------------- 
Accessibility 
    Assembly Version: 4.0.0.0. 
    Win32 Version: 4.0.30319.1 built by: RTMRel. 
    codebase: 
---------------------------------------- 
System.Data 
    Assembly Version: 4.0.0.0. 
    Win32 Version: 4.0.30319.237 (RTMGDR.030319-2300). 
    codebase: 
---------------------------------------- 
System.Core 
    Assembly Version: 4.0.0.0. 
    Win32 Version: 4.0.30319.233 built by: RTMGDR. 
    codebase: 
---------------------------------------- 
System.Xml 
    Assembly Version: 4.0.0.0. 
    Win32 Version: 4.0.30319.233 built by: RTMGDR. 
    codebase: 
---------------------------------------- 
System.Windows.Forms.resources 
    Assembly Version: 4.0.0.0. 
    Win32 Version: 4.0.30319.1 built by: RTMRel. 
    codebase: 
---------------------------------------- 
System.Data.DataSetExtensions 
    Assembly Version: 4.0.0.0. 
    Win32 Version: 4.0.30319.1 built by: RTMRel. 
    codebase: 
---------------------------------------- 
System.Numerics 
    Assembly Version: 4.0.0.0. 
    Win32 Version: 4.0.30319.1 built by: RTMRel. 
    codebase: 
---------------------------------------- 
System.Configuration 
    Assembly Version: 4.0.0.0. 
    Win32 Version: 4.0.30319.1 (RTMRel.030319-0100). 
    codebase: 
---------------------------------------- 
System.Transactions 
    Assembly Version: 4.0.0.0. 
    Win32 Version: 4.0.30319.1 (RTMRel.030319-0100). 
    codebase: 
---------------------------------------- 
System.EnterpriseServices 
    Assembly Version: 4.0.0.0. 
    Win32 Version: 4.0.30319.1 (RTMRel.030319-0100). 
    codebase: 
---------------------------------------- 
mscorlib.resources 
    Assembly Version: 4.0.0.0. 
    Win32 Version: 4.0.30319.235 (RTMGDR.030319-2300). 
    codebase: 
---------------------------------------- 

************** JIT Debugging ************** 
To the JIT debugging (Just-In-Time) to activate, must be in the 
Configuration file of the application or computer 
(Machine.config) jitDebugging the value in the system.windows.forms section are determined. 
The application must be compiled with debugging enabled. 

For example: 

<configuration> 
    <system.windows.forms jitDebugging="true" /> 
</ Configuration> 

When JIT debugging is enabled, any unhandled 
Exceptions to the JIT debugger sent on the 
Computer is registered and handled by this dialog box. 
       ERROR LINES END HERE , THE CODE REFERRING TO ABOVE...Funstions 

的第834行是一个空行....... 私人无效DrawPricePeriods(图形克) { 刷= Brushes.CadetBlue; pen.Color = Color.White; (g,pen,2,50,796,((numAppartments + 1)* 60)+ 200 +(10 *(numAppartments-1)),30); (g,brush,2,50,796,((numAppartments + 1)* 60)+ 200 +(10 *(numAppartments-1)),30);

 RoundRect.DrawRoundRect(g, pen, 2, 50, 796, 200, 30); 
     RoundRect.FillRoundRect(g, brush, 2, 50, 796, 200, 30); 

     sf.Alignment = StringAlignment.Center; 
     brush = Brushes.White; 
     Rectangle rect = new Rectangle(2, 50, 796, 30); 
     Font f = new Font(fontFamily, 12); 
     switch (language) 
     { 
      case 1: 
       g.DrawString("Please enter in the yellow fields you price periods! And white fields your prices!", f, brush, (RectangleF)rect, sf); 
       break; 
      case 2: 
       g.DrawString("Por favor inserte en las casillas blancas sus temporadas!", f, brush, (RectangleF)rect, sf); 
       break; 
      case 3: 
       g.DrawString("Molimo unesite u žutim prozorima periode cijene! I u bijelim vaše cijene", f, brush, (RectangleF)rect, sf); 
       break; 
     } 
     rect = new Rectangle(2, 70, 796, 30); 
     switch (language) 
     { 
      case 1: 
       g.DrawString("Please enter first your day (field TT) and then month (field MM)", f, brush, (RectangleF)rect, sf); 
       break; 
      case 2: 
       g.DrawString("Por favor primero insierta el día (casilla TT) después el mes (casilla MM)", f, brush, (RectangleF)rect, sf); 
       break; 
      case 3: 
       g.DrawString("Molimo prvo unesite datum dana (prozor DD) i onda mijesec (prozor MM)", f, brush, (RectangleF)rect, sf); 
       break; 
     } 
     sf.Alignment = StringAlignment.Near; 
     rect = new Rectangle(255, 50, 796, 30); 
     brush = Brushes.Yellow; 
     if(language == 1) 
     { 
      g.DrawString("yellow", f, brush, (RectangleF)rect, sf); 
     } 

     int w = 140, h = 40, x = 20, y = 150, xinc = 0, yinc = 40; 

     string[] periods = new string[5]; 
     switch (language) 
     { 
      case 1: 
       periods = new string[5] { "First Price Period", "Second Price Period", "Third Price Period", "Fourth Price Period", "Fifth Price Period" }; 
       break; 
      case 2: 
       periods = new string[5] { "Temporada 1", "Temporada 2", "Temporada 3", "Temporada 4", "Temporada 5" }; 
       break; 
      case 3: 
       periods = new string[5] { "Perioda 1", "Perioda 2", "Perioda 3", "Perioda 4", "Perioda 5" }; 
       break; 
     } 

     Point p; 
     int count = 0; 
     switch (numPricePeriods) 
     { 
      case 1: 
       { 
        x = 796/2 - 70; 
        p = new Point(x, y); 
        brush = Brushes.White; 
        g.DrawString(periods[0], f, brush, (PointF)p, sf); 
        brush = Brushes.Yellow; 
        RoundRect.DrawRoundRect(g, pen, x, y + 30, w - 10, h + 10, 10); 
        RoundRect.FillRoundRect(g, brush, x, y + 30, w - 10, h + 10, 10); 
        arrtbxPPDuration[0].Location = new Point(x + 5, y + 45); 
        arrtbxPPDuration[0].ForeColor = Color.Gray; 
        arrtbxPPDuration[0].Text = "TT/MM to TT/MM"; 
        arrtbxPPDuration[0].Show(); 

        yinc = 150; 
        for (int j = 0; j < numAppartments; j++) 
        { 
         RoundRect.DrawRoundRect(g, pen, x, y + yinc, w - 10, 60, 10); 
         brush = Brushes.LightGray; 
         RoundRect.FillRoundRect(g, brush, x, y + yinc, w - 10, 60, 10); 
         arrtbxPricePeriods[count].Location = new Point(x + 5, y + yinc + 15); 
         arrtbxPricePeriods[count].Show(); 
         count++; 
         yinc += 70; 
        } 
       } 
       break; 
      case 2: 
       { 
        x = (796/3); 
        for (int i = 0; i < numPricePeriods; i++) 
        { 
         p = new Point(x - 70, y); 
         brush = Brushes.White; 
         g.DrawString(periods[i], f, brush, (PointF)p, sf); 
         brush = Brushes.Yellow; 
         RoundRect.DrawRoundRect(g, pen, x - 70, y + 30, w - 10, h + 10, 10); 
         RoundRect.FillRoundRect(g, brush, x - 70, y + 30, w - 10, h + 10, 10); 


         //THIS IS THE 834th LINE 


         arrtbxPPDuration[i].Location = new Point(x - 65, y + 45); 
         arrtbxPPDuration[i].ForeColor = Color.Gray; 
         arrtbxPPDuration[i].Text = "TT/MM to TT/MM"; 
         arrtbxPPDuration[i].Show(); 
         x += (796/3); 
        } 


        yinc = 150; 
        for (int i = 0; i < numAppartments; i++) 
        { 
         x = (796/3); 
         for (int j = 0; j < numPricePeriods; j++) 
         { 
          RoundRect.DrawRoundRect(g, pen, x - 70, y + yinc, w - 10, 60, 10); 
          brush = Brushes.LightGray; 
          RoundRect.FillRoundRect(g, brush, x - 70, y + yinc, w - 10, 60, 10); 
          arrtbxPricePeriods[count].Location = new Point(x - 65, y + yinc + 15); 
          arrtbxPricePeriods[count].Show(); 
          count++; 
          x += (796/3); 
         } 
         yinc += 70; 
        } 
       } 
       break; 
      case 3: 
       { 
        x = (796/4); 
        for (int i = 0; i < numPricePeriods; i++) 
        { 
         p = new Point(x - 70, y); 
         brush = Brushes.White; 
         g.DrawString(periods[i], f, brush, (PointF)p, sf); 

         brush = Brushes.Yellow; 
         RoundRect.DrawRoundRect(g, pen, x - 70, y + 30, w - 10, h + 10, 10); 
         RoundRect.FillRoundRect(g, brush, x - 70, y + 30, w - 10, h + 10, 10); 
         arrtbxPPDuration[i].Location = new Point(x - 65, y + 45); 
         arrtbxPPDuration[i].ForeColor = Color.Gray; 
         arrtbxPPDuration[i].Text = "TT/MM to TT/MM"; 
         arrtbxPPDuration[i].Show(); 
         x += (796/4); 
        } 

        yinc = 150; 
        for (int i = 0; i < numAppartments; i++) 
        { 
         x = (796/4); 
         for (int j = 0; j < numPricePeriods; j++) 
         { 
          RoundRect.DrawRoundRect(g, pen, x - 70, y + yinc, w - 10, 60, 10); 
          brush = Brushes.LightGray; 
          RoundRect.FillRoundRect(g, brush, x - 70, y + yinc, w - 10, 60, 10); 
          arrtbxPricePeriods[count].Location = new Point(x - 65, y + yinc + 15); 
          arrtbxPricePeriods[count].Show(); 
          count++; 
          x += (796/4); 
         } 
         yinc += 70; 
        } 
       } 
       break; 
      case 4: 
       { 
        x = (796/5); 
        for (int i = 0; i < numPricePeriods; i++) 
        { 
         p = new Point(x - 70, y); 
         brush = Brushes.White; 
         g.DrawString(periods[i], f, brush, (PointF)p, sf); 

         brush = Brushes.Yellow; 
         RoundRect.DrawRoundRect(g, pen, x - 70, y + 30, w - 10, h + 10, 10); 
         RoundRect.FillRoundRect(g, brush, x - 70, y + 30, w - 10, h + 10, 10); 
         arrtbxPPDuration[i].Location = new Point(x - 65, y + 45); 
         arrtbxPPDuration[i].ForeColor = Color.Gray; 
         arrtbxPPDuration[i].Text = "TT/MM to TT/MM"; 
         arrtbxPPDuration[i].Show(); 
         x += (796/5); 
        } 
        yinc = 150; 
        for (int i = 0; i < numAppartments; i++) 
        { 
         x = (796/5); 
         for (int j = 0; j < numPricePeriods; j++) 
         { 
          RoundRect.DrawRoundRect(g, pen, x - 70, y + yinc, w - 10, 60, 10); 
          brush = Brushes.LightGray; 
          RoundRect.FillRoundRect(g, brush, x - 70, y + yinc, w - 10, 60, 10); 
          arrtbxPricePeriods[count].Location = new Point(x - 65, y + yinc + 15); 
          arrtbxPricePeriods[count].Show(); 
          count++; 
          x += (796/5); 
         } 
         yinc += 70; 
        } 
       } 
       break; 
      case 5: 
       { 
        x = (796/6); 
        int diff = 110; 
        for (int i = 0; i < numPricePeriods; i++) 
        { 
         p = new Point(x - diff, y); 
         brush = Brushes.White; 
         g.DrawString(periods[i], f, brush, (PointF)p, sf); 

         brush = Brushes.Yellow; 
         RoundRect.DrawRoundRect(g, pen, x - diff, y + 30, w - 10, h + 10, 10); 
         RoundRect.FillRoundRect(g, brush, x - diff, y + 30, w - 10, h + 10, 10); 
         arrtbxPPDuration[i].Location = new Point(x - diff + 5, y + 45); 
         arrtbxPPDuration[i].ForeColor = Color.Gray; 
         arrtbxPPDuration[i].Text = "TT/MM to TT/MM"; 
         arrtbxPPDuration[i].Show(); 
         x += (796/6); 
        } 

        yinc = 150; 
        for (int i = 0; i < numAppartments; i++) 
        { 
         x = (796/6); 
         for (int j = 0; j < numPricePeriods; j++) 
         { 
          RoundRect.DrawRoundRect(g, pen, x - diff, y + yinc, w - 10, 60, 10); 
          brush = Brushes.LightGray; 
          RoundRect.FillRoundRect(g, brush, x - diff, y + yinc, w - 10, 60, 10); 
          arrtbxPricePeriods[count].Location = new Point(x - diff + 5, y + yinc + 15); 
          arrtbxPricePeriods[count].Show(); 
          count++; 
          x += (796/6); 
          diff -= 20; 
         } 
         yinc += 70; 
        } 
       } 
       break; 
     } 

    } 

         yinc = 150; 
         for (int i = 0; i < numAppartments; i++) 
         { 
          x = (796/6); 
          for (int j = 0; j < numPricePeriods; j++) 
          { 
           RoundRect.DrawRoundRect(g, pen, x - diff, y + yinc, w - 10, 60, 10); 
           brush = Brushes.LightGray; 
           RoundRect.FillRoundRect(g, brush, x - diff, y + yinc, w - 10, 60, 10); 
           arrtbxPricePeriods[count].Location = new Point(x - diff + 5, y + yinc + 15); 
           arrtbxPricePeriods[count].Show(); 
           count++; 
           x += (796/6); 
           diff -= 20; 
          } 
          yinc += 70; 
         } 
        } 
        break; 
      } 

     } 

我知道它的一个烂摊子,但仍然只给我任何提示,我想不出任何东西.. 谢谢

+0

什么样的错误? –

+0

一切都安装了程序运行,我浏览窗体,,当他们是从SQL数据库加载数据的功能。它给Sql的一些连接错误,在德国不知道这意味着什么。一个警报弹出窗口,所有在德国不能甚至复制它.. –

+0

发布错误,和/或运行它[谷歌翻译](http: //translate.google.com)。 –

回答

0

是的,它是可能的。但是德国人很相似,不太可能。为什么选择德语,让我们回顾一下德语的不同之处:日期格式,小数点逗号而不是小数点?首先,你应该检查你的程序 - 日期和十进制数字转换成文本和文本。

我遇到了一个将所有数据存储为字符串的软件的类似问题。如果您在英文Windows上运行此软件并创建一些数据,它将以小数点(例如1.23)存储。然后,当您尝试从德语Windows上的数据库中读取这些数据时,它不起作用,因为字符串需要用十进制逗号转换为数字(例如,需要1,23,但是存在1.23)。

怎么办: 你应该修复你的程序。在要将日期或数字转换为或从字符串转换的所有地方指定InvariantCulture。请参阅:http://msdn.microsoft.com/en-us/library/ht77y576.aspx

或者您可以尝试将计算机切换到英文语言环境。这将帮助您查看问题是否真的由此造成的。转到控制面板 - 区域和语言选项。您可以设置日期和数字的格式。请看这里:http://www.windows7update.com/Windows7-Regional-and-language-options.html

+0

如何解决呢?如果我不知道德国人?和所有的场景? :| –

+0

我在答复中添加了更多信息。 –

+0

是的,我读了....它的信息.. –

相关问题