|
Firstly, you asked how to combine like and in - thats not what you are asking really.
As I said, its easy enough. This is the sort of 'problem' faced daily, and there are several ways of doing it.
Anudeep Jaiswal wrote: now sir , the ball is in your court... face the problem..
No, the ball is in YOUR court. Post your attempt and I will point out your errors, but I will not write your code for you - its you being paid to do it, not me.
Bob
Ashfield Consultants Ltd
|
|
|
|
|
Anudeep Jaiswal wrote: now sir , the ball is in your court... face the problem..
A little courtesy might go a long way in getting answers to your questions on CP
Continuous effort - not strength or intelligence - is the key to unlocking our potential.(Winston Churchill)
|
|
|
|
|
|
HOW TO CREATE NEW DATABASE USING MS-SQL SERVER 2005 AND PLEASE ALSO
GUIDEME ABOUT THE INSTALLATION PROCESS.
nilesh kumar saraf
|
|
|
|
|
Hi Nilesh,
You can do so with the use of Data Adapter and Dataset. for details you can get sample code in C# programming by wrox publication. and of course the MSDN.
|
|
|
|
|
The statement is Simple
Create Database MyDatabase
But am worried about your post, because it tells me that you did not read any book about SQL. I suggest you get a Book in Introduction to Database Design in SQL .
Vuyiswa Maseko,
Sorrow is Better than Laughter, it may Sadden your Face, but It sharpens your Understanding
VB.NET/SQL7/2000/2005
http://vuyiswamb.007ihost.com
http://Ecadre.007ihost.com
vuyiswam@tshwane.gov.za
|
|
|
|
|
This is exactly the type of question that should not be answered here. You have not taken the time to do any research on the topic and expect the nice folks here to do your job for you. Forget about it.
Don't waste our time.
|
|
|
|
|
hi folks,
A SP in sql server is not returning a string variable as output variable ..can any1 let me know how to return a string variable from SP in sql server?A function returns a string variable whereas a SP doesnt return.y?
for e.g I have created a SP
create procedure SP_abc(
@a INT
@b out VARCHAR(10)
)
as
begin
set @b = 'ABCD'
end
How to get the value of b in the front end?
T.Balaji
|
|
|
|
|
Error 1 DO NOT PREFIX YOUR PROCEDURES WITH SP
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Error 1 DO NOT PREFIX YOUR PROCEDURES WITH SP it forces the compiler to go through ALL the system procedures (sp)
Having said that try changing out to output, the only thing I can see that may be a problem.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
hi
Try this
create procedure SP_abc(
@a INT,
@b VARCHAR(10) OUTPUT
)
as
begin
set @b = 'ABCD'
end
Hope it helps
Vuyiswa Maseko,
Sorrow is Better than Laughter, it may Sadden your Face, but It sharpens your Understanding
VB.NET/SQL7/2000/2005
http://vuyiswamb.007ihost.com
http://Ecadre.007ihost.com
vuyiswam@tshwane.gov.za
modified on Monday, August 4, 2008 3:29 AM
|
|
|
|
|
That is unlikely to even compile. There is a missing comma between the second and third line.
|
|
|
|
|
Thanks i Fixed it
Vuyiswa Maseko,
Sorrow is Better than Laughter, it may Sadden your Face, but It sharpens your Understanding
VB.NET/SQL7/2000/2005
http://vuyiswamb.007ihost.com
http://Ecadre.007ihost.com
vuyiswam@tshwane.gov.za
|
|
|
|
|
How is this any different from the OP's SQL Code?
|
|
|
|
|
I dont understand your Question, i just took the Output keywork to the End of the declaration line.
Vuyiswa Maseko,
Sorrow is Better than Laughter, it may Sadden your Face, but It sharpens your Understanding
VB.NET/SQL7/2000/2005
http://vuyiswamb.007ihost.com
http://Ecadre.007ihost.com
vuyiswam@tshwane.gov.za
|
|
|
|
|
Ah, so you did!
|
|
|
|
|
Vuyiswa Maseko,
Sorrow is Better than Laughter, it may Sadden your Face, but It sharpens your Understanding
VB.NET/SQL7/2000/2005
http://vuyiswamb.007ihost.com
http://Ecadre.007ihost.com
vuyiswam@tshwane.gov.za
|
|
|
|
|
i cudnt get wht u ppl say..is it working 5n?can u tell me whether ure able to access the value at the front end?
T.Balaji
|
|
|
|
|
balaji.t wrote: cudnt
balaji.t wrote: wht
balaji.t wrote: ppl
balaji.t wrote: 5n
balaji.t wrote: u
balaji.t wrote: ure
None of these words are in my dictionary. I don't understand what you are saying.
|
|
|
|
|
I really dont Understand what you are saying. Do you speak English?
Vuyiswa Maseko,
Sorrow is Better than Laughter, it may Sadden your Face, but It sharpens your Understanding
VB.NET/SQL7/2000/2005
http://vuyiswamb.007ihost.com
http://Ecadre.007ihost.com
vuyiswam@tshwane.gov.za
|
|
|
|
|
hi folks,
Ill put my doubt clearly.Wht i sent earlier is a chat slang ...Can u tell me whether it is possible to return a string value as output in the front end using a Stored Procedure?
Ive created a stored procedure like this
CREATE PROCEDURE [dbo].[StoredProcedure1]
(
@a int,
@b varchar(10) output
)
AS
BEGIN
set @b = 'RE00001'
--set @b = 20
--return @b
END
in LINQ
-------
i call the sp like this
DC1DataContext obj = new DC1DataContext();
string b = null;
string c = obj.StoredProcedure1(1, ref b).ToString();
I face 2 issues
1.if I give return @b(thats y commented) then i get error since sp doesnt return a string
2.if i dont give return then in the code behind i get 0 as the value of c.
can u let me know whether is it possible to return a string using SP?
if so how?
T.Balaji
|
|
|
|
|
hi man
balaji.t Wrote:Can u tell me whether it is possible to return a string value as output in the front end using a Stored Procedure?
Yes its Possible. In your Situation just look at some of my artcles i have done that.
if you are using C#, just do the Following
cmdselect.Parameters.Add("@OutString", SqlDbType.VarChar, 10);
cmdselect.Parameters["@OutRess"].Direction = ParameterDirection.Output;
con.Open();
cmdselect.ExecuteNonQuery();
RString = Convert.ToString(cmdselect.Parameters["@OutRess"].Value);
con.Close();
Hope this Helps
Vuyiswa Maseko,
Sorrow is Better than Laughter, it may Sadden your Face, but It sharpens your Understanding
VB.NET/SQL7/2000/2005
http://vuyiswamb.007ihost.com
http://Ecadre.007ihost.com
vuyiswam@tshwane.gov.za
|
|
|
|
|
hi,
thanx budduy...its working well with normal sql conenction i want the same in LINQ
T.Balaji
|
|
|
|
|
You were supplied a keyboard with your computer, USE THE BLOODY THING.
Credibility -5
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
hi,
Holmes stay cool.dont get tensed..Ive sent my clarification clearly.
T.Balaji
|
|
|
|