Convert java code to C#after getting the resultset in a db java users a setString(int, string
Page 1 of 1
11 Replies - 10267 Views - Last Post: 10 March 2008 - 07:17 AM
#1
Convert java code to C#
Posted 06 March 2008 - 01:12 PM
public int findNumericSeqCode(Connection myConn, String standard, String hostName)
.
.
cs = myConn.prepareCall("{call matchHost(@pHost=?)}");
cs.setString(1, hostName + "[0-9][0-9]");
ResultSet myHosts = cs.executeQuery();
cs is a callable statement.
What is the C# equivalent of a setString()?
Thank
Replies To: Convert java code to C#
#2
Re: Convert java code to C#
Posted 06 March 2008 - 02:33 PM
#3
Re: Convert java code to C#
Posted 06 March 2008 - 03:02 PM
(Please be sure to post what you have in the proper section of the forums)
#4
Re: Convert java code to C#
Posted 07 March 2008 - 07:40 AM
Jesus.
This post has been edited by papuccino1: 07 March 2008 - 08:50 AM
#5
Re: Convert java code to C#
Posted 07 March 2008 - 08:04 AM
papuccino1, on 7 Mar, 2008 - 09:40 AM, said:
Actually, no.
He's looking for database code equating to prepareCall, which is not a trivial answer. The way the question is phrased would lead anyone with expirience to believe that the Q&A session following any answer would be long, drawn out, and painful. The question shows not just an unfamiliarity with C#, but also Java and OO in general. Answering such a question is like sliding down a hill razor blades into a pool of alcohol. Any sane person whould shy away.
Ok, coffee has kicked in. This is all I'll say:
The answer would be to look all the DbCommand interface. Better yet, actually read something about C# database connections. PsychoCoder's tutorial OleDb Data Objects in C# has the answer, for instance.
Good luck.
#6
Re: Convert java code to C#
Posted 07 March 2008 - 08:24 AM
papuccino1, on 7 Mar, 2008 - 06:40 AM, said:
Jesus.
WTF??!! I went and looked at the threads you started and all your questions were answered, so I don't understand you're reaction here
EDIT: and this is a community, we volunteer our time, free I might add, to help people the best we can. We are not, however, here to just do peoples work. As baavgai stated, if he knew anything about Java, C# or OO he would know where to start, then if he ran into trouble after that he could have asked for help.
We push people to solve their problems, we are here to help after they've at least tried to solve it themselves. If they cant help themselves how are they going to make it in the real world as a programmer?
This post has been edited by PsychoCoder: 07 March 2008 - 08:27 AM
#7
Re: Convert java code to C#
Posted 07 March 2008 - 08:27 AM
PsychoCoder, on 7 Mar, 2008 - 08:24 AM, said:
papuccino1, on 7 Mar, 2008 - 06:40 AM, said:
Jesus.
WTF??!! I went and looked at the threads you started and all your questions were answered, so I don't understand you're reaction here
Yeah, you guys did help me! And I'm massively thankful! I'm just annoyed that someone asks a simple question that isn't even asking for full code, and some of you just type: "Please use [code] for your questions"
If he's asking it means that he doesn't know. Why not help someone out?
Edit: Here's his question again:
What is the C# equivalent of a setString()?
I would answer him if I knew. And I know the answer isn't more than 3 lines. :S
This post has been edited by papuccino1: 07 March 2008 - 08:29 AM
#8
Re: Convert java code to C#
Posted 07 March 2008 - 08:30 AM
#9
Re: Convert java code to C#
Posted 07 March 2008 - 08:34 AM
"What is the equivilant of print() in C++?"
You wouldn't answer me? How can I attempt something when I don't even know the function? Everyone starts out somewhere.
baavgai, on 7 Mar, 2008 - 08:04 AM, said:
THAT sounded painful!
#10
Re: Convert java code to C#
Posted 07 March 2008 - 08:50 AM
#11
Re: Convert java code to C#
Posted 07 March 2008 - 09:05 AM
papuccino1, on 7 Mar, 2008 - 07:34 AM, said:
"What is the equivilant of print() in C++?"
If you asked that question, without any preface as he did, my first thought would be why you didn't use Google. If you had you would at least have something to show you tried. Had he tried Google he would have found his answer here
All we ask is that someone try before abandoning it and wanting someone else to give them what they need before even attempting to figure out themselves
#12
Re: Convert java code to C#
Posted 10 March 2008 - 07:17 AM
public int setString(long pos,
java.lang.String s);
check this link out for the C# setString Method it takes one more parameter
http://msdn2.microso...513(VS.85).aspx

New Topic/Question
Reply



MultiQuote






|