|
Could you please stop using the phrase "Greetings Gurus"? You don't need to use it to get help - just keep asking decent questions and provide us with enough information to help. By using this phrase, you're coming across as a crawler - and that's a bit offputting.
|
|
|
|
|
Hi Pete,
My apologies if you found the greeting distasteful, it was meant to be cheerful and recogniscent of the superior abilities held by some of those in the forum .
I shall refrain in the future.
Thanks for pointing it out.
|
|
|
|
|
CCodeNewbie wrote: recogniscent of the superior abilities
That implies an elitism that doesn't exist. We may have more experience in some areas, but this does not infer any form of superior ability. Each of us has deficiencies in our knowledge that others cover for - for instance, I tend not to answer much on the p/invoke side because it's not an area I deal much with.
[Edit]Don't get me wrong - you ask good questions. You provide detail and clarification, along with actual code. That means we are more than happy to help, so just keep this part up and we'll all be happy.
|
|
|
|
|
Will do
|
|
|
|
|
Hello Experts,
I would like to ask even though I manage to add the Merge Module for visual studio 2010 so that I can deploy my Application that uses crystal report I still got the error below.
Could not load file or assembly CrystalDecisions.Windows.Forms.Version=13.0.2000.0
See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.
************** Exception Text **************
System.IO.FileNotFoundException: Could not load file or assembly 'CrystalDecisions.Windows.Forms, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304' or one of its dependencies. The system cannot find the file specified.
File name: 'CrystalDecisions.Windows.Forms, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304'
at SimplyOutbound.Form1.InitializeComponent()
at SimplyOutbound.Form1..ctor()
at SimplyOutbound.ReportGenerator.btnView_Click(Object sender, EventArgs e)
at System.Windows.Forms.Control.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ButtonBase.WndProc(Message& m)
at System.Windows.Forms.Button.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
WRN: Assembly binding logging is turned OFF.
To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.
Note: There is some performance penalty associated with assembly bind failure logging.
To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].
Any advice, suggestion are so much appreciated.
Thanks,
DAN
|
|
|
|
|
Hello,
I was a bit lucky I manage to fix it also. I am not sure but might be helpful to others also, it seems the error can be done by the previous version of crystal report that is being installed in the client machine. I tried to properly uninstall the previous version of the crystal report then repeat the same I process until its successful.
|
|
|
|
|
|
I'm a relatively new C# programmer and am using datagridview to maintain my data. However, some of the tab pages in my application need to show data and data subsets in a different format. Some of it will be row-based instead of column-based. Here's an example; if I have 4 objects, each taking up one row of a datagrid in the first tab I will need to break that up into 4 columns per object in another tab for a total of 16 columns and another tab will break that into 4 groups of 6 rows for a total of 24 rows. I also might want to get rid of the grid "look" and show it in more of a row-based/column based reporting format that will still be bound to a set of underlying methods. Before I start trying to do this with datagridview (perhaps it's not even possible) does anyone out there have any better ideas as to how to go about this? The key is that the data has to be bound to underlying calculations, kind of like a spreadsheet, but I need a lot of flexibility as to how I go about it. Thanks in advance.
|
|
|
|
|
On a tangent:
Tom Paronis wrote: need to show data
Don't show data; show information.
Tom Paronis wrote: am using datagridview
|
|
|
|
|
I'm using VS2008 with C# and SQL CF v3.5 to create an inventory application for a mobile computer. I have never worked with SQL Compact before, but I'm pretty sure I've got it right from the database perspective. I've added my DataSource, TableAdapters, queries to fill my ComboBoxes, etc. When I deploy to my WM 6.5 device, I've made sure that the SQL Compact CAB files have been installed, and that the database exists on the device. When I use any of the ComboBoxes in the form, they are all blank and none of them are populated. In VS 2008 when I 'Preview Data' it's all there. Not sure where to go from here to debug?
|
|
|
|
|
I’m writing one program (C# .Net 3.5) for temperature values reception from some device through COM port. The program (for convenient postprocessing of temperature values) divides received data on (figure 1):
MEASURE – continuous sequence of temperature values.
SET – consecutive set of several MEASUREs. Each SET is separated from another SET by a certain interval of time. For example, 15 minutes. After this time limit the program closes current SET and opens a new SET.
DAY – set of SETs received during a day.
The program seems to work as it supposed. But sometimes there is an overlapping of MEASUREs of different SETs of a DAY. For example, a MEASURE of one SET could be an absolute copy of a MEASURE of some another following SET (figure 2). Or any SET besides of its own MEASUREs can contain all MEASUREs of all following SETs. As a result some SET has MEASURE(s) which do not belong to it.
I have an idea that List M (see the code) of a SET sometimes during a day can refer on itself and on List M of the previous SET. It is incredible, because only one (current) SET and its (current) MEASURE could be active; the rest should be closed and not active.
What is wrong? What recommendations you will advise to reveal this bug?
figure 1
figure 2
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO.Ports;
namespace WindowsFormsApplication1
{
class MyPoint
{
public double x;
public double y;
}
class Measurement
{
List<MyPoint> points = new List<MyPoint>();
public void Add(MyPoint p)
{
points.Add(p);
}
}
class Set
{
public Measurement CurrentM = null;
List<Measurement> M = new List<Measurement>();
public Measurement GetNewM()
{
Measurement m = new Measurement();
return m;
}
public void CreateMesurement()
{
CurrentM = GetNewM();
M.Add(CurrentM);
}
}
class Day
{
public Set CurrentS = null;
List<Set> S = new List<Set>();
public void OnSetCreation()
{
CurrentS = new Set();
S.Add(CurrentS);
}
public void OnMeasureCreation()
{
CurrentS.CreateMesurement();
}
public void WriteData()
{
}
}
static class DaysConteiner
{
static public Day Active;
static double Temperature;
static bool IfThereIsAGapBetweenTempuratureValues = false;
static bool IfThereIsSetTimeLimitElapsed = false;
static bool IfNewDay = false;
static void OnStartNewDay()
{
if (IfNewDay)
{
Active.WriteData();
Active = new Day();
}
}
static internal void OnDataFromCOMPortReceived()
{
if (IfThereIsSetTimeLimitElapsed) Active.OnSetCreation();
if (IfThereIsAGapBetweenTempuratureValues) Active.OnMeasureCreation();
MyPoint p = new MyPoint();
p.x = DateTime.Now.ToOADate();
p.y = Temperature;
Active.CurrentS.CurrentM.Add(p);
}
}
}
|
|
|
|
|
I realize that is cut down to show us what you are doing, but my best guess is that it has to do with IfNewDay - you don't show the code which changes it, so I can only assume that the problem is there. If it is not set at the correct point, then you won't generate a new list, and your new samples will be added to the wrong day.
In addition, it looks like (from your mentioning Invoke) that you are using multiple threads - have you ensured your code is thread safe? If at the least, you may need to look at locking around:
if (IfNewDay)
{
Active.WriteData();
Active = new Day();
} to prevent other tasks adding to Active while it is being written.
Ideological Purity is no substitute for being able to stick your thumb down a pipe to stop the water
|
|
|
|
|
I don't use multiple threads. Invoke is needed for safe receiving data from COM port.
Actually there is no
IfNewDay variable. Switching of a DAY depends on timer. Its tick time (TT) is evaluated every time when new DAY starts. If there is no any MEASURE (coming temperature values from device) at 24h (stating of a new day) than TT = 24hours, else TT = 24h-(Time for MEASURE). When you start the programm TT=24h-(Current time).
All overlapping of MEASUREs as it seems to me take place within a DAY. Different SETs sometimes has MEASUREs of their own and equal (bug) MEASUREs.
|
|
|
|
|
Hi again,
I don't see where it is wrong, I might need to see more code.
However, there is one thing that I don't like at all:
Member 8075591 wrote: Active.CurrentS.CurrentM.Add(p);
each day has a current set, each set has a current measurement. However, as I understand it your system only needs one current measurement overall, so having a lot of them is just asking for trouble.
|
|
|
|
|
You are one handred percent right! And I'll think how to change my code to follow you advice!
But I wonder how such things can happen!? If you are interested also I can comment all places you will ask and send you all my code.
|
|
|
|
|
dear guys, i need help about this C# class code.
i think this class is used to force the program to read sqlconnection string from a file with xml extension.
i needed someone to translate this coding into vb.net so it's easier for me to understand it.
thanks before.
using System;
using System.IO;
using System.Xml;
using System.Xml.XPath;
namespace Core.Classes
{
public class Configuration
{
public class ProgramClass
{
public string Id { get; set; }
public string Name { get; set; }
public string DefaultCurrency { get; set; }
}
public class ConnectionClass
{
public string Provider { get; set; }
public string String { get; set; }
}
public ConnectionClass Connection { get; set; }
public ProgramClass Program { get; set; }
protected XPathNavigator nav = null;
public Configuration()
{
this.Connection = new ConnectionClass();
this.Program = new ProgramClass();
}
public bool Open(ProviderCollection providers, string filename)
{
if (!File.Exists(filename))
{
return false;
}
try
{
XmlDocument doc = new XmlDocument();
doc.Load(filename);
this.nav = doc.CreateNavigator();
return true;
}
catch
{
return false;
}
}
public virtual bool Read()
{
try
{
this.nav = nav.SelectSingleNode("//connection");
this.Connection.Provider = this.nav.GetAttribute("provider", "");
this.Connection.String = this.nav.GetAttribute("connection_string", "");
this.nav = nav.SelectSingleNode("//program");
this.Program.Id = this.nav.GetAttribute("id", "");
this.Program.Name = this.nav.GetAttribute("name", "");
this.Program.DefaultCurrency = this.nav.GetAttribute("default_currency", "");
return true;
}
catch
{
return false;
}
}
}
}
modified 18-Nov-11 23:53pm.
|
|
|
|
|
Here
Public Class Configuration
Public Class ProgramClass
Public Property Id() As String
Get
Return m_Id
End Get
Set
m_Id = Value
End Set
End Property
Private m_Id As String
Public Property Name() As String
Get
Return m_Name
End Get
Set
m_Name = Value
End Set
End Property
Private m_Name As String
Public Property DefaultCurrency() As String
Get
Return m_DefaultCurrency
End Get
Set
m_DefaultCurrency = Value
End Set
End Property
Private m_DefaultCurrency As String
End Class
Public Class ConnectionClass
Public Property Provider() As String
Get
Return m_Provider
End Get
Set
m_Provider = Value
End Set
End Property
Private m_Provider As String
Public Property [String]() As String
Get
Return m_String
End Get
Set
m_String = Value
End Set
End Property
Private m_String As String
End Class
Public Property Connection() As ConnectionClass
Get
Return m_Connection
End Get
Set
m_Connection = Value
End Set
End Property
Private m_Connection As ConnectionClass
Public Property Program() As ProgramClass
Get
Return m_Program
End Get
Set
m_Program = Value
End Set
End Property
Private m_Program As ProgramClass
Protected nav As XPathNavigator = Nothing
Public Sub New()
Me.Connection = New ConnectionClass()
Me.Program = New ProgramClass()
End Sub
Public Function Open(providers As ProviderCollection, filename As String) As Boolean
If Not File.Exists(filename) Then
Return False
End If
Try
Dim doc As New XmlDocument()
doc.Load(filename)
Me.nav = doc.CreateNavigator()
Return True
Catch
Return False
End Try
End Function
Public Overridable Function Read() As Boolean
Try
Me.nav = nav.SelectSingleNode("//connection")
Me.Connection.Provider = Me.nav.GetAttribute("provider", "")
Me.Connection.[String] = Me.nav.GetAttribute("connection_string", "")
Me.nav = nav.SelectSingleNode("//program")
Me.Program.Id = Me.nav.GetAttribute("id", "")
Me.Program.Name = Me.nav.GetAttribute("name", "")
Me.Program.DefaultCurrency = Me.nav.GetAttribute("default_currency", "")
Return True
Catch
Return False
End Try
End Function
End Class
I just used developerfusion's converter application[^].
Next time you can go straight there.
Good luck.
When I was a coder, we worked on algorithms. Today, we memorize APIs for countless libraries — those libraries have the algorithms - Eric Allman
|
|
|
|
|
thank's a lot, but am i right about the function of this class?
|
|
|
|
|
It looks like it.
When I was a coder, we worked on algorithms. Today, we memorize APIs for countless libraries — those libraries have the algorithms - Eric Allman
|
|
|
|
|
okay thankyou then
|
|
|
|
|
Glad to help!
When I was a coder, we worked on algorithms. Today, we memorize APIs for countless libraries — those libraries have the algorithms - Eric Allman
|
|
|
|
|
The first thing to try in future is to use one of the online translation services - I use DeveloperFusion[^]
Ideological Purity is no substitute for being able to stick your thumb down a pipe to stop the water
|
|
|
|
|
If you read my original answer, you will note I told him the same thing. In fact that is all I did
When I was a coder, we worked on algorithms. Today, we memorize APIs for countless libraries — those libraries have the algorithms - Eric Allman
|
|
|
|
|
Sorry! I saw a large wodge of VB and didn't read to the end...
Ideological Purity is no substitute for being able to stick your thumb down a pipe to stop the water
|
|
|
|
|
No need to be sorry! There is no harm in reinforcing issues like that. They should learn to start helping themselves
When I was a coder, we worked on algorithms. Today, we memorize APIs for countless libraries — those libraries have the algorithms - Eric Allman
|
|
|
|