Click here to Skip to main content
15,891,473 members
Home / Discussions / Database
   

Database

 
AnswerRe: a month all dates want to display..., Pin
Mike Dimmick7-Jul-07 2:32
Mike Dimmick7-Jul-07 2:32 
GeneralRe: a month all dates want to display..., Pin
Member 38798818-Jul-07 19:10
Member 38798818-Jul-07 19:10 
GeneralRe: a month all dates want to display..., Pin
Pete O'Hanlon8-Jul-07 23:05
mvePete O'Hanlon8-Jul-07 23:05 
Questionms access +c#.net (date comparison) Pin
hk779216-Jul-07 8:48
hk779216-Jul-07 8:48 
QuestionNetwork error while connecting to DB2/MVS from .Net Pin
viv_bhatt6-Jul-07 5:55
viv_bhatt6-Jul-07 5:55 
AnswerRe: Network error while connecting to DB2/MVS from .Net Pin
Mike Dimmick6-Jul-07 6:38
Mike Dimmick6-Jul-07 6:38 
GeneralRe: Network error while connecting to DB2/MVS from .Net Pin
viv_bhatt6-Jul-07 7:17
viv_bhatt6-Jul-07 7:17 
Questionsql query Pin
Laxmi R6-Jul-07 3:58
Laxmi R6-Jul-07 3:58 
Hi
Please help me. I used the following code in my site. but it didn't work.


public string InsertMailDetails()
{
string strResult=string.Empty;
sbQuery=new StringBuilder();
try
{
sbQuery.Append("Declare @Toid int ");
sbQuery.Append("if exists(select intUser_Id from tbl_User_info where txtEmail='" + strMailToId + "') ");
sbQuery.Append("Begin ");
sbQuery.Append("Set @Toid=(select intUser_Id from tbl_User_info where txtEmail='" + strMailToId + "') ");
sbQuery.Append("Insert into tbl_Mail_info(intUserId,intFromId,Subject,Message,intRead,Maildate) ");
sbQuery.Append("values( @Toid," + strMailFromId + ",'" + strSubject + "','" + strMessage + "',0,'" + DateTime.Today.ToShortDateString() + "')");
sbQuery.Append("End ");
sbQuery.Append("else ");
sbQuery.Append("Begin ");
sbQuery.Append("Select 0 ");
sbQuery.Append("End");
strResult=csDataAccess.ExecuteNonQuery(sbQuery.ToString()).ToString();
// strResult = csDataAccess.ExecuteScalar(sbQuery.ToString()).ToString();
}
catch
{

}
return strResult;
}

After above code executes, strResult is "". Why?


Declare @Toid int if exists(select intUser_Id from tbl_User_info where txtEmail='rgadi_iginc@yahoo.com') Begin Set @Toid=(select intUser_Id from tbl_User_info where txtEmail='rgadi_iginc@yahoo.com') Insert into tbl_Mail_info(intUserId,intFromId,Subject,Message,intRead,Maildate) values( @Toid,226,'test','test mail',0,'7/6/2007')End else Begin Select 0 End

Laxmi

laxmi

AnswerRe: sql query Pin
Vishu Gurav6-Jul-07 11:11
Vishu Gurav6-Jul-07 11:11 
AnswerRe: sql query Pin
Mike Dimmick6-Jul-07 13:36
Mike Dimmick6-Jul-07 13:36 
GeneralRe: sql query Pin
Laxmi R8-Jul-07 19:54
Laxmi R8-Jul-07 19:54 
AnswerRe: sql query Pin
N a v a n e e t h9-Jul-07 0:36
N a v a n e e t h9-Jul-07 0:36 
QuestionSQL Server 2000 - nested / recursive triggers? Pin
nr1b6-Jul-07 3:44
nr1b6-Jul-07 3:44 
AnswerRe: SQL Server 2000 - nested / recursive triggers? Pin
N a v a n e e t h9-Jul-07 0:41
N a v a n e e t h9-Jul-07 0:41 
Questionneed query for date....................... Pin
HemMagesh6-Jul-07 2:15
HemMagesh6-Jul-07 2:15 
AnswerRe: need query for date....................... Pin
Pete O'Hanlon6-Jul-07 4:12
mvePete O'Hanlon6-Jul-07 4:12 
GeneralRe: need query for date....................... Pin
Member 38798816-Jul-07 18:28
Member 38798816-Jul-07 18:28 
Questionplz give answer Pin
help as an alias5-Jul-07 23:25
help as an alias5-Jul-07 23:25 
AnswerRe: plz give answer Pin
rah_sin5-Jul-07 23:30
professionalrah_sin5-Jul-07 23:30 
GeneralRe: plz give answer Pin
help as an alias6-Jul-07 0:05
help as an alias6-Jul-07 0:05 
GeneralRe: plz give answer Pin
rah_sin6-Jul-07 0:22
professionalrah_sin6-Jul-07 0:22 
AnswerThe rules Pin
leckey6-Jul-07 3:12
leckey6-Jul-07 3:12 
QuestionHow can i recover my database using LDF file .... Pin
koolprasad20035-Jul-07 23:08
professionalkoolprasad20035-Jul-07 23:08 
AnswerRe: How can i recover my database using LDF file .... Pin
Mike Dimmick6-Jul-07 3:09
Mike Dimmick6-Jul-07 3:09 
GeneralRe: How can i recover my database using LDF file .... Pin
koolprasad20036-Jul-07 19:21
professionalkoolprasad20036-Jul-07 19:21 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.