473,804 Members | 3,163 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

what is equivalent in c# of a char in sql?

I have a stored procedure using a char(10),
I need to specify that param in c#. What c# data type is
can I use?

I've looked around online for equivalents between sql
types and c# types and couldn't find anything.

I know this is basic, but i can't find the answer.
thanks in advance.
Nov 16 '05 #1
4 5392
I never use that one however probably char[10]
Nov 16 '05 #2
-----Original Message-----
I never use that one however probably char[10]
.
you're not understanding my question.

Nov 16 '05 #3
To be used with SqlParameter class? SqlDbType.Char:

SqlCommand cmd = new SqlCommand();
cmd.Parameters. Add("@myParam", SqlDbType.Char) ;
cmd.Parameters[0].Value = "foo";

HTH,
Alexander

<an*******@disc ussions.microso ft.com> wrote in message
news:5c******** *************** *****@phx.gbl.. .
I have a stored procedure using a char(10),
I need to specify that param in c#. What c# data type is
can I use?

I've looked around online for equivalents between sql
types and c# types and couldn't find anything.

I know this is basic, but i can't find the answer.
thanks in advance.

Nov 16 '05 #4
ah i see, its a string.

cheers.
Nov 16 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
2142
by: Job Lot | last post by:
I have an enumeration as follows Public Enum Delimiters Tab Semicolon Comma Space End Enum How can I return character equivalent of the elements in the enumeration?
16
10836
by: jonathan cano | last post by:
QUESTION: In practice, lines 36 and 37 below are usually equivalent to the default copy constructor (.e.g line 33). My questions are: (a) Does ISO 14882 guarantee that lines 36 and 37 are equivalent to executing the default copy constructor (i.e. lines 33)? (b) If not, is the behavior for lines 36-39 well defined by the standard?
10
15666
by: tinesan | last post by:
Hello fellow C programmers, I'm just learning to program with C, and I'm wondering what the difference between signed and unsigned char is. To me there seems to be no difference, and the standard doesn't even care what a normal char is (because signed and unsigned have equal behavior). For example if someone does this: unsigned char a = -2; /* or = 254 */
11
1875
by: JS | last post by:
In K&R I have found this: static char allocbuf; static char *allocp = allocbuf; But *allocp has not been set to point at anything yet so how is it possible to make the contents of an unknown address be "allocbuf"?? JS
7
3730
by: Tim Conner | last post by:
Hi, I am an ex-delphi programmer, and I having a real hard time with the following simple code (example ): Which is the equivalent to the following code ? var chars : PChar; sBack, s : String;
3
26883
by: charliewest | last post by:
Can anyone tell me what the C# equivalent of the VB Chr() Function? I need to insert a single-byte character into a label control at run time. For example: Dim s = "Hello" + Chr(32)
14
2558
by: grid | last post by:
Hi, I have a certain situation where a particular piece of code works on a particular compiler but fails on another proprietary compiler.It seems to have been fixed but I just want to confirm if both statements are similar : *((char **)v)++ == *((char **)v++) Where v is a pointer to an array of characters,defined as char *v;
5
14120
by: Omats.Z | last post by:
what is meaning os "char **option meet"? I get a function like this: __________________________________ int getchoice(char *greet, char *choices) { int chosen = 0; int selected; char **option; // what is this line mean? do { printf("Choice: %s\n", greet);
3
4903
by: Angus | last post by:
Hello I need to port some Java code and am wondering if there is a close equivalent to ByteArrayOutputStream. I have been looking at the STL iostream library but not quite sure what is best to use. Any help would be much appreciated.
28
3816
by: gnuist006 | last post by:
I have some code like this: (if (test) (exit) (do something)) or (if (test)
0
9585
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10338
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10082
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9161
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7622
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5525
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5658
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4301
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2997
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.