G
Guest
Hello Everyone,
I have a huge string and I want to get just part of the string and pass it
in my stored proc. I am trying to do it through a structure. I am not sure if
this is the best way and right way to do it.
Below is the sample code
String x = "This is a test. Test done by xyz";
[StructLayout(LayoutKind.Sequential, Pack = 1)]
public unsafe struct member
{
public fixed char region[5];
public fixed char lastName[10];
}
I want to do something like this that if I call the struct, it should go and
get me the region from the string.
The region is 5 characters long and pass that region as a parameter to the
stored proc.
The above string is a huge string. i am just giving a sample. I just have to
get the parts of the string
and pass them as parameter to the stored proc. Someone suggested me that
structure will be the best appraoch for this
but since it is a unsafe struct. I am little bit reluctant to use it. I am
wondering if someone can give me a better appraoch or f this the best
appraoch then how can use it.
command.Parameters.Add(new OracleParameter("mrnprefix",
OracleType.VarChar)).Value = region from a structure
Thanks.
I have a huge string and I want to get just part of the string and pass it
in my stored proc. I am trying to do it through a structure. I am not sure if
this is the best way and right way to do it.
Below is the sample code
String x = "This is a test. Test done by xyz";
[StructLayout(LayoutKind.Sequential, Pack = 1)]
public unsafe struct member
{
public fixed char region[5];
public fixed char lastName[10];
}
I want to do something like this that if I call the struct, it should go and
get me the region from the string.
The region is 5 characters long and pass that region as a parameter to the
stored proc.
The above string is a huge string. i am just giving a sample. I just have to
get the parts of the string
and pass them as parameter to the stored proc. Someone suggested me that
structure will be the best appraoch for this
but since it is a unsafe struct. I am little bit reluctant to use it. I am
wondering if someone can give me a better appraoch or f this the best
appraoch then how can use it.
command.Parameters.Add(new OracleParameter("mrnprefix",
OracleType.VarChar)).Value = region from a structure
Thanks.