473,394 Members | 1,739 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

TypeCode

122 100+
Ok here is the situation i am porting a project from vb.net to C# and i have the following issues and i don't know how to resolve them.

VB.NET
Expand|Select|Wrap|Line Numbers
  1.  
  2. Public Class TextFieldEnumerator
  3. Inherits Object
  4. Implements System.Collections.IEnumerator
  5. Private iEnBase As System.Collections.IEnumerator
  6. Private iEnLocal As System.Collections.IEnumerable
  7. ''' <summary>
  8. ''' Enumerator constructor
  9. ''' </summary>
  10. Public Sub New(ByVal texMappings As TextFieldCollection)
  11. MyBase.New()
  12. Me.iEnLocal = CType(texMappings, System.Collections.IEnumerable)
  13. Me.iEnBase = iEnLocal.GetEnumerator
  14. End Sub
  15. ''' <summary>
  16. ''' Gets the current element from the collection (strongly typed)
  17. ''' </summary>
  18. Public ReadOnly Property Current() As TextField
  19. Get
  20. Return CType(iEnBase.Current, TextField)
  21. End Get
  22. End Property
  23. ''' <summary>
  24. ''' Gets the current element from the collection
  25. ''' </summary>
  26. ReadOnly Property System_Collections_IEnumerator_Current() As Object Implements System.Collections.IEnumerator.Current
  27. Get
  28. Return iEnBase.Current
  29. End Get
  30. End Property
  31. ''' <summary>
  32. ''' Advances the enumerator to the next element of the collection
  33. ''' </summary>
  34. Public Function MoveNext() As Boolean
  35. Return iEnBase.MoveNext
  36. End Function
  37. ''' <summary>
  38. ''' Advances the enumerator to the next element of the collection
  39. ''' </summary>
  40. Function System_Collections_IEnumerator_MoveNext() As Boolean Implements System.Collections.IEnumerator.MoveNext
  41. Return iEnBase.MoveNext
  42. End Function
  43. ''' <summary>
  44. ''' Sets the enumerator to the first element in the collection
  45. ''' </summary>
  46. Public Sub Reset()
  47. iEnBase.Reset()
  48. End Sub
  49. ''' <summary>
  50. ''' Sets the enumerator to the first element in the collection
  51. ''' </summary>
  52. Sub System_Collections_IEnumerator_Reset() Implements System.Collections.IEnumerator.Reset
  53. iEnBase.Reset()
  54. End Sub
  55. End Class
  56.  
C# converted code :
Expand|Select|Wrap|Line Numbers
  1. public class TextFieldEnumerator : TypeCode, System.Collections.IEnumerator
  2. {
  3. private System.Collections.IEnumerator iEnBase;
  4. private System.Collections.IEnumerable iEnLocal;
  5. // '' <summary>
  6. // '' Enumerator constructor
  7. // '' </summary>
  8. public TextFieldEnumerator(TextFieldCollection texMappings)
  9. {
  10. this.iEnLocal = ((System.Collections.IEnumerable)(texMappings));
  11. this.iEnBase = iEnLocal.GetEnumerator;
  12. }
  13. // '' <summary>
  14. // '' Gets the current element from the collection (strongly typed)
  15. // '' </summary>
  16. public TextField Current
  17. {
  18. get
  19. {
  20. return ((TextField)(iEnBase.Current));
  21. }
  22. }
  23. object System_Collections_IEnumerator_Current
  24. {
  25. get
  26. {
  27. return iEnBase.Current;
  28. }
  29. }
  30. public bool MoveNext()
  31. {
  32. return iEnBase.MoveNext;
  33. }
  34. // '' <summary>
  35. // '' Advances the enumerator to the next element of the collection
  36. // '' </summary>
  37. bool System_Collections_IEnumerator_MoveNext()
  38. {
  39. return iEnBase.MoveNext;
  40. }
  41. // '' <summary>
  42. // '' Sets the enumerator to the first element in the collection
  43. // '' </summary>
  44. public void Reset()
  45. {
  46. iEnBase.Reset();
  47. }
  48. // '' <summary>
  49. // '' Sets the enumerator to the first element in the collection
  50. // '' </summary>
  51. void System_Collections_IEnumerator_Reset()
  52. {
  53. iEnBase.Reset();
  54. }
  55. }
  56.  
  57.  
  58.  

AND number 2.....

.NET
Expand|Select|Wrap|Line Numbers
  1. Public Property DataType() As TypeCode
  2. Get
  3. Return _dataType
  4. End Get
  5. Set(ByVal Value As TypeCode)
  6. _dataType = Value
  7. End Set
  8. End Property
  9.  
  10. C#
  11.  
  12. public TypeCode DataType
  13. {
  14. get
  15. {
  16. return _dataType;
  17. }
  18. set
  19. {
  20. _dataType = value;
  21. }
  22. }
  23.  
  24.  

The C# doesn't work because it doesn't recognize TypeCode for both converstions, what can i replace the Typecode with in C# to get this working ? Any help someone can offer would be appreciated for this newbie!!
Oct 30 '07 #1
46 3760
Shashi Sadasivan
1,435 Expert 1GB
Have you set your editor setting in the control panel (of tsdn) as enhanced mode?

Need a moderator / admin to change your code...cant follow it. Once thats done decypering it will be easier :D unless u plan to manually remove all the size and color tags
Oct 30 '07 #2
Killer42
8,435 Expert 8TB
I would have a go at fixing it, but I have no idea what all the <summary> tags mean.
Oct 30 '07 #3
Shashi Sadasivan
1,435 Expert 1GB
I would have a go at fixing it, but I have no idea what all the <summary> tags mean.
Arent those xml comments?
except the '' will have to be removed and replaced by ///
Oct 30 '07 #4
Killer42
8,435 Expert 8TB
Arent those xml comments?
except the '' will have to be removed and replaced by ///
Since I have no idea what you mean, I'd better not touch it.
Oct 30 '07 #5
DragonLord
122 100+
it should look fine now i did it in notepad and removed all the tags
Oct 30 '07 #6
DragonLord
122 100+
oh those tags, forget those they are in the comments. i am just focusing on the lines that use TypeCode as a datatype it is a vb .net data type and i have no idea how to replace it in C#
Oct 30 '07 #7
DragonLord
122 100+
C#:

public TypeCode DataType

VB .NET:

Public Property DataType() As TypeCode

The VB.Net one is fine it works but I want to use C# so i used a converter and it gave me the above... however TypeCode is not recognized by the C# compiler so what do i replace it with????
Oct 30 '07 #8
Shashi Sadasivan
1,435 Expert 1GB
typecode is not a datatype, its an enumerator
Oct 30 '07 #9
Plater
7,872 Expert 4TB
Is TypeCode used to pass in a a DateType? Like in the days of c++ myclass<T> kinda deal?
Just try using Type
Oct 30 '07 #10
DragonLord
122 100+
Is TypeCode used to pass in a a DateType? Like in the days of c++ myclass<T> kinda deal?
Just try using Type

See told you I was a newbie and yes i believe it is used to pass in a datatype.
Oct 30 '07 #11
Plater
7,872 Expert 4TB
Well I'm not sure hot to fix this:
Expand|Select|Wrap|Line Numbers
  1. public class TextFieldEnumerator : TypeCode, System.Collections.IEnumerator
  2.  

But this would be like:
Expand|Select|Wrap|Line Numbers
  1. public System.Type DataType
  2. {
  3.    get
  4.    {
  5.       return _dataType;
  6.    }
  7.    set
  8.    {
  9.       _dataType = value;
  10.    }
  11. }
  12.  
Oct 30 '07 #12
DragonLord
122 100+
OK how could we write this:
Oct 30 '07 #13
DragonLord
122 100+
OK how could we write this:

VB .NET
Public Class TextFieldEnumerator
Inherits Object
Implements System.Collections.IEnumerator
Private iEnBase As System.Collections.IEnumerator
Private iEnLocal As System.Collections.IEnumerable

in C#??
Oct 30 '07 #14
Plater
7,872 Expert 4TB
this didn't work?

Expand|Select|Wrap|Line Numbers
  1. public class TextFieldEnumerator : object, System.Collections.IEnumerator 
  2.     private System.Collections.IEnumerator iEnBase; 
  3.     private System.Collections.IEnumerable iEnLocal; 
  4.  
Oct 30 '07 #15
DragonLord
122 100+
Thanks Plater,

leaves me with this error in at runtime

Error 1 'TextFieldCollection.TextFieldEnumerator' does not implement interface member 'System.Collections.IEnumerator.Current'. 'TextFieldCollection.TextFieldEnumerator.Current' is either static, not public, or has the wrong return type. C:\Users\Dale\Downloads\Documents\Visual Studio 2005\Projects\CIMImporter\CIMImporter\TextFieldPar ser.cs 649 17 CIMImporter


But it fixed the other one's lol... getting closer.
Oct 30 '07 #16
r035198x
13,262 8TB
Thanks Plater,

leaves me with this error in at runtime

Error 1 'TextFieldCollection.TextFieldEnumerator' does not implement interface member 'System.Collections.IEnumerator.Current'. 'TextFieldCollection.TextFieldEnumerator.Current' is either static, not public, or has the wrong return type. C:\Users\Dale\Downloads\Documents\Visual Studio 2005\Projects\CIMImporter\CIMImporter\TextFieldPar ser.cs 649 17 CIMImporter


But it fixed the other one's lol... getting closer.
Implementing an interface is the same as signing a contract which says that "I swear to implement all the methods defined in that interface otherwise I'm going to declare that I'm abstract"
Oct 30 '07 #17
Plater
7,872 Expert 4TB
You are claiming to use the interface, but have not implemented all the required methods.
http://msdn2.microsoft.com/en-us/lib...r_members.aspx
Implement the one it says and try it out.
Oct 30 '07 #18
DragonLord
122 100+
Thanks Plater you have been super helpful and using someone elses code sure makes learning a little easier... I was confused by that error because of this..


object System_Collections_IEnumerator_Current
{
get
{
return iEnBase.Current;
}
}

aparently the translator I used doesn't speak a very good c# lol it should have been


object System.Collections.IEnumerator.Current
{
get
{
return iEnBase.Current;
}
}


I looked a little harder because I knew i had the implementation there lol.
Oct 30 '07 #19
DragonLord
122 100+
Plater I have another bump, in vb.net i have the following



Imports System.Data
Imports System.Data.SqlClient
Public Class Order
Inherits DataServiceBase
Public Sub New()
MyBase.New()
End Sub
Public Sub New(ByVal trans As IDbTransaction)
MyBase.New(trans)
End Sub

Public Function InsertOrder(ByVal xmlStr As String) As Integer
Dim OrderNo As Integer = -1
Dim param As SqlParameter = CreateParameter("@lNewOrderID", SqlDbType.Int, OrderNo, ParameterDirection.Output)
ExecuteNonQuery("sp_TracksOrders_Import", CreateParameter("@xsDetails", SqlDbType.VarChar, xmlStr, 6000), _
param)
OrderNo = param.Value
Return OrderNo
End Function
End Class

The line that is giving me trouble in the conversion is
------ Inherits DataServiceBase

The c# code comes out like this but it doesn't recognize DataServiceBAse

using System.Data;
using System.Data.SqlClient;
public class Order : DataServiceBase
{
public Order()
{
}
public Order(IDbTransaction trans)
:
base(trans)
{
}
public int InsertOrder(string xmlStr)
{
int OrderNo = -1;
SqlParameter param = CreateParameter("@lNewOrderID", SqlDbType.Int, OrderNo, ParameterDirection.Output);
ExecuteNonQuery("sp_TracksOrders_Import", CreateParameter("@xsDetails", SqlDbType.VarChar, xmlStr, 6000), param);
OrderNo = param.Value;
return OrderNo;
}
}
Oct 31 '07 #20
DragonLord
122 100+
ignore above i was missing a class.
Oct 31 '07 #21
Plater
7,872 Expert 4TB
Can you help me understand what they are trying to do with the following declaration:


Private _delimiter As Char = Convert.ToChar(",")
it works fine in vb.net but when i try to convert it in C# it tells me it cannont convert to type char from type char.
I don't know why the go the long way in that statement. "." is a string containing a period '.' is character that is a period. Double-quotes are used for strings, single-quotes for characters.
The end result of that statement would be this:
private char _deliminator = '.';
Oct 31 '07 #22
DragonLord
122 100+
I don't know why the go the long way in that statement. "." is a string containing a period '.' is character that is a period. Double-quotes are used for strings, single-quotes for characters.
The end result of that statement would be this:
private char _deliminator = '.';
Your kidding me all that nonsense to declare and set a variable?
Oct 31 '07 #23
Plater
7,872 Expert 4TB
oh umm that might be a comma and not a period inside there. My font is really small and I can't tell the difference.
Oct 31 '07 #24
DragonLord
122 100+
Thanks I knew what you meant....

How about this

DataFile.TextFields.Add(new TextField(FieldName, TypeCode.Int32, Quoted));


This is what the translator shot back but it doesn't like the Typecode.Int32 and I tried to investicate the System.Type but that didn't work...

Any thoughts?

Thank God for you amazing people out here for us newbies to sap the knowledge out of!!!
Nov 1 '07 #25
Plater
7,872 Expert 4TB
Maybe:
DataFile.TextFields.Add(new TextField(FieldName, Typeof(Int32), Quoted));
Nov 1 '07 #26
DragonLord
122 100+
Yes sir seemed to like that but now it is grumbling about DataFile I looked it up and the namespace is

Namespace: Microsoft.SqlServer.Management.Smo
Assembly: Microsoft.SqlServer.Smo (in microsoft.sqlserver.smo.dll)

I tried to add it:

Using Microsoft.SqlServer. (only option is Server)
Nov 1 '07 #27
Plater
7,872 Expert 4TB
Well I dunno what DataFile is, but SqlServer stuff is:
System.Data.SqlClient


Is this it?
http://msdn2.microsoft.com/en-us/lib....datafile.aspx
Nov 1 '07 #28
DragonLord
122 100+
good Question this is what i found

http://technet.microsoft.com/en-us/l....datafile.aspx
Nov 1 '07 #29
Plater
7,872 Expert 4TB
You probably need to add a reference to the .dll -> microsoft.sqlserver.smo.dll
Go to references and Add and then look for it, it's under the .NET tab, you would search by it's namespace name. I found it in mine at least.
Nov 1 '07 #30
DragonLord
122 100+
Ah see I learned something new today, thank-you so much for your patience. However, I must have the wrong one because it doesn't contain any of the methods the old code is using lol.
Nov 1 '07 #31
DragonLord
122 100+
Ok another vb convertion messup....

if (!(input[x]==null)) <---------------

where input is a string array ...... ref string input[]

it keeps telling me it is a variable in the if statement used as a method, i understand what it is doing however i am not sure how to correct the implementation.
Nov 1 '07 #32
Plater
7,872 Expert 4TB
What is the VB code and what is the proposed C# code?

if (!(input[x]==null))
would be more likely written as:
if (input[x]!=null)

provided that input is an array:
<sometype>[] input = new <sometype>[<size>];
Nov 2 '07 #33
DragonLord
122 100+
[font=Arial]Below is another issue, basically everything i can work with except the [/font]

The Dim statement I am not sure what it is doing with rawFields() is this not a method of runction... it is pulled from the Utilities.Text.Parsing namespace...


[font=Arial] Private Function GetFieldArray(ByVal fileRecord As String) As Array
Dim fields As Array = Nothing
Select Case Me.FileType
Case FileFormat.Delimited
' split the fields
Dim rawFields() As String = fileRecord.Split(Convert.ToChar(Me.Delimiter))
' recombine any with quotes
RecombineQuotedFields(rawFields)
' remove the extra elements
ExtractNullArrayElements(rawFields, fields)
Case FileFormat.FixedWidth
Dim rawFields As New ArrayList
Dim mark As Int32 = 0
For x As Int32 = 0 To _textFields.Count - 1
' extract the value and move the book mark
rawFields.add(fileRecord.Substring(mark, _textFields(x).Length))
mark += _textFields(x).Length
Next[/font]
[font=Arial] fields = rawfields.ToArray
Case Else
Throw New ApplicationException("The specified FileType is not valid.")
End Select
Return fields
End Function[/font]
Nov 2 '07 #34
Plater
7,872 Expert 4TB
I think there were some types on that (you had two objects called rawFields and no object called _textFields)

Expand|Select|Wrap|Line Numbers
  1. private Array GetFieldArray(string fileRecord) 
  2.     Array fields = null; 
  3.     switch (this.FileType) 
  4.     { 
  5.         case FileFormat.Delimited: 
  6.             // split the fields 
  7.             string[] _textFields= fileRecord.Split(Convert.ToChar(this.Delimiter)); 
  8.             // recombine any with quotes 
  9.             RecombineQuotedFields(rawFields); 
  10.             // remove the extra elements 
  11.             ExtractNullArrayElements(rawFields, fields); 
  12.             break; 
  13.         case FileFormat.FixedWidth: 
  14.             ArrayList rawFields = new ArrayList(); 
  15.             Int32 mark = 0; 
  16.             for (Int32 x = 0; x <= _textFields.Count - 1; x++) 
  17.             { 
  18.                 // extract the value and move the book mark 
  19.                 rawFields.add(fileRecord.Substring(mark, _textFields[x].Length)); 
  20.                 mark += _textFields[x].Length; 
  21.             } 
  22.  
  23.             fields = rawfields.ToArray(); 
  24.             break; 
  25.         default: 
  26.             throw new ApplicationException("The specified FileType is not valid."); 
  27.             break; 
  28.     } 
  29.     return fields; 
  30.  
Nov 2 '07 #35
DragonLord
122 100+
One more issue I borrowed some files from another application and brought them inhouse under the same namespace (Good Idea? Bad Idea? not sure )

but regardless I have everything working except ......

TextFieldParser tfp;
//string filePath = Path.Combine(Path.GetDirectoryName(Application.Exe cutablePath), "Delimited.txt");
string filepath = myFilePath;
tfp = new TextFieldParser(myFilePath);
TextFieldCollection fields = new TextFieldCollection();
fields.Add(new TextField("Station", TypeCode.String, true));
fields.Add(new TextField("Reference", TypeCode.String, true));
fields.Add(new TextField("Name", TypeCode.String, true));
fields.Add(new TextField("Address 1", TypeCode.String, true));
fields.Add(new TextField("Adress 2", TypeCode.String, true));
fields.Add(new TextField("City", TypeCode.String, true));
fields.Add(new TextField("ST", TypeCode.String, true));
fields.Add(new TextField("ZIP", TypeCode.Int32));
fields.Add(new TextField("PH", TypeCode.Int32));
fields.Add(new TextField("Alt. PH", TypeCode.Int32));
fields.Add(new TextField("Waybill", TypeCode.String, true));
fields.Add(new TextField("Notes 1", TypeCode.String, true));
fields.Add(new TextField("Notes 2", TypeCode.String, true));
fields.Add(new TextField("Date", TypeCode.String, true));
tfp.TextFields = fields;


[BOLD] tfp.RecordFailed += new RecordFailedHandler(tfp_RecordFailed); [/BOLD]

This line throws an error no matter where it is daying "does not exist in current context" should i change the namespace back to the orginal and just include it with the using clause or is there a way to fix this as is???
Nov 6 '07 #36
Plater
7,872 Expert 4TB
Expand|Select|Wrap|Line Numbers
  1. tfp.RecordFailed += new RecordFailedHandler(tfp_RecordFailed); 
  2.  
Is how you attach event handlers. This is looking for the function called "tfp_RecordFailed" so it can use it for the RecordFailed event.
You will need to copy that function over as well.
Nov 6 '07 #37
DragonLord
122 100+
Thanks I am learning alot with this little project of mine,


one more question in c# what is the best way to get the ascii value of a char(x)
Nov 6 '07 #38
Plater
7,872 Expert 4TB
Maybe I am thinking to fast but this should work:
Expand|Select|Wrap|Line Numbers
  1. char mychar='x';
  2. int asciivalue=(int)mychar;
  3.  
Nov 6 '07 #39
DragonLord
122 100+
[font=Arial]
Orginal VB.NET

Dim OrderNo As Integer = -1
Dim param As SqlParameter = CreateParameter("@lNewOrderID", SqlDbType.Int, OrderNo, ParameterDirection.Output)
ExecuteNonQuery("sp_TracksOrders_Import", CreateParameter("@xsDetails", SqlDbType.VarChar, xmlStr, 6000), _
param)
OrderNo = param.Value
Return OrderNo

VB.NET Function

Protected Sub ExecuteNonQuery(ByVal procName As String, ByVal ParamArray paramList() As IDataParameter)
Dim cmd As SqlCommand = Nothing
ExecuteNonQuery(cmd, procName, paramList)
End Sub


problem is when i convert this to C# it is not creating a parameter list and instead goes to another fucntion that is an overload with 3 parameters.

any thoughts how to redo this in c#.. basically i just need guidence on passing it with a parameter list


i.e.

ExecuteNonQuery("sp_TracksOrders_Import", parmeterlist??)[/font]
Nov 12 '07 #40
Plater
7,872 Expert 4TB
Expand|Select|Wrap|Line Numbers
  1. Protected Sub ExecuteNonQuery(ByVal procName As String, ByVal ParamArray paramList() As IDataParameter)
  2.  
This should be like:
Expand|Select|Wrap|Line Numbers
  1. protected void ExecuteNonQuery(string procName, params IDataParameter[] ParamArray)
  2.  
Nov 12 '07 #41
DragonLord
122 100+
Sorry I was referring to the function call.


ExecuteNonQuery("sp_TracksOrders_Import", CreateParameter("@xsDetails", SqlDbType.VarChar, xmlStr, 6000), _
param)

This comes from a different class calling the ExecuteNonQuerey as you described above but as you can see it has or at least it thinks it has 3 parameters instead of a string and a parameter list...

this ends up going straight to another overload function ExecuteNonQuery(cmd,procname,paramlist)

any thoughts?
Nov 12 '07 #42
Plater
7,872 Expert 4TB
This call:
Expand|Select|Wrap|Line Numbers
  1. ExecuteNonQuery("sp_TracksOrders_Import", CreateParameter("@xsDetails", SqlDbType.VarChar, xmlStr, 6000), _param)
  2.  
certainly seems like it fits into the (string, params[]) format to me?


Expand|Select|Wrap|Line Numbers
  1. IDataParameter temp =CreateParameter("@xsDetails", SqlDbType.VarChar, xmlStr, 6000);
  2. //somewhere else another IDataParameter is defined as "param"
  3. ExecuteNonQuery("sp_TracksOrders_Import", temp,param);
  4.  
That would call that ExecuteNonQuery(string, params IDataParameter[] myparams); function?
Nov 13 '07 #43
DragonLord
122 100+
Thanks I found the problem because of that post, turns out the translator i used went and put



sqlparameter param = xxxxxx

and that was where the problem was arrising once i did it as above it corrected the problem now i have to troubleshoot the connection lol... it just never ends!!!
Nov 13 '07 #44
DragonLord
122 100+
Ok one more question

I am new to event handling in C# and here is the situation

I believe I have all the parts, I have the deligate named recordhandler
the class with the ations to be taken

in the class that is calling it though (rasing the event so to speak) how to i tell it to call it.

if (RecordFound != null)
RecordFound(ref currentLineNumber, m_TextFieldSchema.TextFields);
m_CurrentLineNumber = currentLineNumber;



Record found in the try block is always null even though it is doing it's thing... how do i tell it before it gets to the if statement that a record was found?

Thanks
Dale.
[/size]
Nov 15 '07 #45
Plater
7,872 Expert 4TB
Are you wondering how to trigger your custom event?

Here's a slimmed down version of what I use for one of my things
Expand|Select|Wrap|Line Numbers
  1. public delegate int RequestReceivedHandler(Socket RequestingSocket, Request TheRequest);
  2. public class HttpListener
  3. {
  4.    /// <summary>
  5.    /// The even for when HttpListener has received a request and read the data
  6.    /// </summary>
  7.    public event RequestReceivedHandler RequestReceived;
  8.  
  9.    public void MockFire()
  10.    {
  11.       Socket mySocket;//fake
  12.       Request myRequest;//fake
  13.       int retval = RequestReceived(mySocket, myRequest);//fire the event
  14.    }
  15. }
  16.  
Nov 15 '07 #46
DragonLord
122 100+
[size=2]tfp.RecordFound += new RecordFoundHandler([/size][size=2]tfp_RecordFound);[/size]
[size=2][/size]
[size=2]Thanks, that sample helped I was missing this from the originating class.
[/size]
Nov 15 '07 #47

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: johkar | last post by:
In the below example I am using the following to try to match only the unique MechanismText nodes within each Subscription node: select="DeliveryPreferences/DeliveryPreference" Right now, the...
3
by: Steve Brown | last post by:
Hello all, Is there a way to determine a variable's type at run-time? The reason I'm asking is that i have code that looks like this: template <class T> Object::Object(int TypeCode, T* data)...
3
by: HairlipDog58 | last post by:
Does anyone know if there is a built-in function for creating a Type from a TypeCode? Type t = somefunction(TypeCode.Int16);
10
by: crowl | last post by:
I have a pocket pc project in c#. From a textbox i have to verify if the input is numeric. I have found in the msdn a sample like this: textbox1.numeric = true / false. But this do not work in...
9
by: **Developer** | last post by:
I do the following: Select Case mDataType(mColumnToSort) Case TypeCode.Int32 Result = CInt(xText).CompareTo(CInt(yText)) Case TypeCode.String
4
by: Demetri | last post by:
I have a method that has a parameter that accepts a System.Type. How can I test to see if the type passed is one of the numeric types? I want to avoid a big if/else or switch statement if...
12
by: sck10 | last post by:
Hello, I am trying to determine if a value is NOT numeric in C#. How do you test for "Not IsNumeric"? protected void fvFunding_ItemInserting_Validate(object sender, FormViewInsertEventArgs...
26
by: Neville Lang | last post by:
Hi all, I am having a memory blank at the moment. I have been writing in C# for a number of years and now need to do something in VB.NET, so forgive me such a primitive question. In C#, I...
1
by: JRD | last post by:
Greetings, I would like to search down through the following xml string that is returned to my calling app via a webservice. What I am trying to get is the following section from the xml string ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.