|
I do not find type "LineDefinition" anywhere.
I derived following code from your distorted code.
public sealed class GLine
{
#region Variables
private bool m_IsDataCorrect;
private LineDefinition m_ContentFormat;
private short m_CRCComputed = -1, m_CRCGiven = -1;
private string m_Code, m_Value;
#endregion
#region public Accessors
public string Code
{
get { return m_Code; }
set { m_Code = value; }
}
public LineDefinition ContentFormat
{
get { return m_ContentFormat; }
set { m_ContentFormat = value; }
}
public string Value
{
get { return m_Value; }
set
{
m_Value = value;
ComputeState();
}
}
public short CRCComputed
{
get
{
return m_CRCComputed;
}
}
public short CRCGiven
{
get { return m_CRCGiven; }
set
{
m_CRCGiven = value;
ComputeState();
}
}
public bool IsDataCorrect
{
get
{
return m_CRCGiven != -1 && m_IsDataCorrect;
}
}
public bool IsDefinitionAvailable
{
get
{
return m_ContentFormat != null;
}
}
#endregion
#region public non default Constructs
public GLine(string code, string value, short givencrc)
{
m_Code = code;
m_Value = value;
m_CRCGiven = givencrc;
ComputeState();
}
public GLine(string code, string value)
{
m_Code = code;
m_Value = value;
m_CRCComputed = Common.CalcCRC(value);
}
public GLine(string code, LineDefinition definition)
{
m_Code = code;
m_ContentFormat = definition;
}
#endregion
private void ComputeState()
{
m_CRCComputed = Common.CalcCRC(m_Value);
m_IsDataCorrect = m_CRCGiven == m_CRCComputed;
}
}
So unable to find what is exact problem with
this code...
Hope this will help!
Jinal Desai - LIVE
Experience is mother of sage....
|
|
|
|
|
Hi all,
I am facing problem in displaying the Date formate in Excel .
From Database i am displaying the Date lets say the Formate "dd/mm/yy" e.g 03/05/10. nothing but (3rd May 2010)
The above formate is displaying in correctly in English settings but when the client generating the excel, there it is displaying as "05/03/10" i mean day and month are interchanging.
(Because they are using Italian settings due to this reason date is displaying like 05/03/10)
Can any body help on this?Date formate should not interchange
Thanks in advance,
Balu.
|
|
|
|
|
|
|
I would leave it as is.
They have Italian settings for a reason (are they Italian perhaps) so they will want dates to show in the Italian format.
The only time I think it is legitimate to force a date format is with regard to American settings when coding for British users. Unfortunately Microsoft in their wisdom default English settings to be American English, even on editions of software produced specifically for the British market. Consequently many British people have American settings by mistake. This is especially a problem with SQL Server, which will not install in British English no matter how hard you try (causing no end of trouble with reporting services), and must be changed afterwards. In fact only the execution language can be changed, the root installed language settings cannot be changed! All other culture settings should be respected.
|
|
|
|
|
I am trying to parse the following JSON string, to get the genre, id, and photo in a list.
[
{
id: "6"
genre: "Music"
photo: "music.jpg"
},
{
id: "2"
genre: "Entertainment"
photo: "enter.png"
},
{
id: "8"
genre: "Games"
photo: "games.gif"
},
{
id: "7"
genre: "Movies"
photo: "movie.gif"
},
{
id: "9"
genre: "News"
photo: "news.jpg"
},
{
id: "5"
genre: "Mail"
photo: "Mail.gif"
}
]
I tried using the JSON.Net library, but could not really use it, due to lack of examples.
If anyone can help in getting the id, genre, and photo in a list, that would be really helpful!
*Also, I am using the Compact Framework, WM 6.
Thanks,
Harsimran Singh
1) The good news about computers is that they do what you tell them to do. The bad news is that they do what you tell them to do. - Ted Nelson
2) Why is it drug addicts and computer afficionados are both called users? - Clifford Stoll
3) The real danger is not that computers will begin to think like men, but that men will begin to think like computers. - Sydney J. Harris
(Computer code: 00001111 - translation: Hello! :P )
REMEMBER:
"Computers are made for us, we are not made for them
|
|
|
|
|
Have you looked at JavaScript Object Notation Support for .NET 2.0[^]
You should never use standby on an elephant. It always crashes when you lift the ears. - Mark Wallace
C/C++ (I dont see a huge difference between them, and the 'benefits' of C++ are questionable, who needs inheritance when you have copy and paste) - fat_boy
|
|
|
|
|
The JSON.Net library isn't too hard to use. The documentation can be a bit hard to follow at times, but at lot of the mess comes from the really bad LINQ examples.
Create a class to encapsulate the id, genre, and photo fields. I'll just call it Section for this example. Then use this code to get your list of Section objects:
List<Section> products = JsonConvert.DeserializeObject<List<Section>>(jsonString);
|
|
|
|
|
Thanks!
That worked perfectly for me!!
1) The good news about computers is that they do what you tell them to do. The bad news is that they do what you tell them to do. - Ted Nelson
2) Why is it drug addicts and computer afficionados are both called users? - Clifford Stoll
3) The real danger is not that computers will begin to think like men, but that men will begin to think like computers. - Sydney J. Harris
(Computer code: 00001111 - translation: Hello! :P )
REMEMBER:
"Computers are made for us, we are not made for them
|
|
|
|
|
Hi
In my application i am trying to play up to 12 videos simultaneously and I am accessing the videos on a mapped network drive. Can someone please point me at some literature or some examples of buffering video files.
Thanx
|
|
|
|
|
|
I have done code to print the table columns using SQLDMO.
How can i acces the data of the tables? pl reply quickly
|
|
|
|
|
If you can print the columns using SQLDMO, then you must know the following.
1. Database name
2. Table names
3. Column names
With those three you have enough information to use standard queries to retrieve the data. Don't forget to use Parameterised queries to avoid SQL Injection attacks.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
Thing is that I want to print table rows with change of database dynamically in a combobox.So I cannot predefine the database.I have Printed columns dynamically using SQLDMO.Column2 .Similarly can i use some tools to print datas of the tables.Can u help me?
|
|
|
|
|
I am not sure that I understand exactly what you are saying.
Do you mean that the database names are in a combobox and when that changes, you want to do your printing?
Or are you saying that you want to print the data in a combobox when the database changes for some unspecified reason?
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
1)I have two combo box.
2)First one will show all DataBases in a particular Server
3) Second one will show all Tables in the coreesponding Database Selected from Above
4)Connection is defined in Webconfig
5)When I press Generate Script(button) it should print INSERT command
Since In webconfig I have said DBaseName
I could get column Script Using SQLDMO.
I couldnot get Row Script for other tables.
I want to use SQLDMO Direcly to a table to get the rows?
Hope you got Some Idea
|
|
|
|
|
Thank you for clarifying, I understand now.
I have a very similar app but mine is on Windows Forms. In mine I do pretty much as you do, except that I have 1 ComboBox and 1 ListBox. For my app I fall back to standard SQL Queries for data retrieval (as I said before by this stage you have all necessary information to do so) because, as far as I know, SMO/DMO has no commands suitable for this purpose.
The only way that I am aware of to use DMO for this is as described in this[^] article. See the 'Issuing a DDL or DML Command' section.
I hope that this is of some help to you.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
Thank you Henry Minute for Clearing My doubt.See U later ok.
|
|
|
|
|
Hi,
I have a class (call it Fred) which contains several static classes (call them Freds_Box1, Freds_Box2 etc) which are identical in structure.
In a component I have a "Fred_Box". I want to be able to select which "Fred_Box" this points to out of all the "Freds_Boxe's" in "Fred" using the property explorer.
Defining the components "Freds Box" selection in code is easy and works perfectly but as Fred will be accessed by a whole bunch of components using data sources contained in the "Freds Box" selected, I need to be able to do this from the property explorer.
This is hard to explain, I hope it makes sense - here is some example code (untested, but it should hopefully get the point across!).
public class Fred
{
public static Freds_Box1 = new Freds_Box();
public static Freds_Box2 = new Freds_Box();
}
public partial class SomeComponent : UserControl
{
//the code way which works but isn't selectable:-
//private Freds_Box _Local_Freds_Box = Fred.Freds_Box1;
private Freds_Box _Local_Freds_Box;
//this property does not allow selecting anything, how can I "point" it at "Fred"
//so that I can select say "Freds_Box_1" from the list?
public Local_Freds_Box
{
get { return Local_Freds_Box; }
set { Local_Freds_Box = value; }
}
}
Any help with this would be greatly appreciated!!
Thanks.
|
|
|
|
|
Why don't you make a collection of Freds_Box()?
|
|
|
|
|
I should have mentioned that the application will contain multiple forms, with multiple components that access data in Fred. Would a collection still help me with that? (I have only just started using collections and don't really understand them properly yet).
|
|
|
|
|
Go easy, start with plain arrays: (of course replace Freds_Box with the REAL class)
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApplication2
{
public class Freds_Box
{
public int somedata;
public Freds_Box(int HowMuch)
{
somedata = HowMuch;
}
}
public class Fred
{
private Freds_Box[] freds_Boxes = new Freds_Box[] {new Freds_Box(25),
new Freds_Box(79)
};
public Freds_Box[] Freds_Boxes
{
get { return freds_Boxes; }
set { freds_Boxes = value; }
}
}
class Program
{
static void Main(string[] args)
{
Fred container = new Fred();
Console.Write(container.Freds_Boxes[0].somedata);
Console.Write(container.Freds_Boxes[1].somedata);
}
}
}
|
|
|
|
|
What are you actually trying to achieve with this?
I ask because it seems a long winded way to do whatever it is you are trying to do.
What is it not working? I tried it and it worked fine (I had to dummy the Freds_Box class):
public class Fred
{
public static Freds_Box Freds_Box1 = new Freds_Box("Box 1");
public static Freds_Box Freds_Box2 = new Freds_Box("Box 2");
}
public class Freds_Box
{
public string Fred;
public Freds_Box(string init)
{
Fred = init;
}
}
public partial class SomeComponent
{
private Freds_Box _Local_Freds_Box;
public SomeComponent(int i)
{
if (i == 1)
{
_Local_Freds_Box = Fred.Freds_Box1;
}
else
{
_Local_Freds_Box = Fred.Freds_Box2;
}
}
public Freds_Box Local_Freds_Box
{
get { return _Local_Freds_Box; }
set { Local_Freds_Box = value; }
}
}
and a button:
private void button1_Click(object sender, EventArgs e)
{
SomeComponent sc1 = new SomeComponent(1);
SomeComponent sc2 = new SomeComponent(2);
MessageBox.Show("sc1: " + sc1.Local_Freds_Box.Fred + "\n" + "sc2: " + sc2.Local_Freds_Box.Fred);
}
Message box:
"sc1: Box 1"
"sc2: Box 2"
You should never use standby on an elephant. It always crashes when you lift the ears. - Mark Wallace
C/C++ (I dont see a huge difference between them, and the 'benefits' of C++ are questionable, who needs inheritance when you have copy and paste) - fat_boy
|
|
|
|
|
Hello All ,
Is there a way to display list (containing strings) items in a message box?
List<string> test = new List<string>();
test.add("one");
test.add("two");
test.add("three");
And then displaying all the list items together in a single message box?
Like
<br />
MessageBox.Show(test);
Thanks,
|
|
|
|
|
Not as far as I am aware.
However, a Messagebox is nothing much more than a Dialog. Design your own.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|