15,891,905 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Javascript questions
View Visual Basic questions
View Python questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by Adarsh chauhan (Top 194 by date)
Adarsh chauhan
13-Nov-13 0:09am
View
Nice link Ron Beyer.. +5
Adarsh chauhan
10-Nov-13 23:48pm
View
I don't know.. I am asking this for me, if there is any way, as I will do it by writing function ( In case of VS 3.5)
Adarsh chauhan
8-Nov-13 7:03am
View
.ToTitleCase is not available in VS 3.5 or lower versions.. Is there any way( other than writing a user defined function) to achieve this??
Adarsh chauhan
7-Nov-13 0:18am
View
Nice.. +5
Adarsh chauhan
8-Oct-13 1:02am
View
you have not provided enough information.
Please share your table structure and SP so that we can help you..
Adarsh chauhan
26-Sep-13 2:02am
View
agree.. +5
Adarsh chauhan
13-Sep-13 6:28am
View
see the improved solution..
Adarsh chauhan
13-Sep-13 6:27am
View
Deleted
see the improved solution..
Adarsh chauhan
13-Sep-13 5:45am
View
completely agree... +5
Adarsh chauhan
13-Sep-13 5:44am
View
I agree..
Adarsh chauhan
13-Sep-13 5:41am
View
I agree with BulletVictim... you need to share your code so that it would be easy for us to help you..
Adarsh chauhan
5-Sep-13 2:38am
View
Share your SP.. can't help you without that..
Adarsh chauhan
30-Aug-13 2:01am
View
Good one.. my vote of 5
Adarsh chauhan
29-Aug-13 4:45am
View
nice link.... +5
Adarsh chauhan
29-Aug-13 2:37am
View
+5
Adarsh chauhan
29-Aug-13 2:33am
View
I agree.. +5
Adarsh chauhan
26-Aug-13 2:21am
View
I agree with Saqib..
Also I would suggest you to use parameters in your query instead of string concatenation to avoid sql injection.
Adarsh chauhan
21-Aug-13 4:58am
View
Good One.. +5
Adarsh chauhan
21-Aug-13 4:57am
View
Nice one.. +5
Adarsh chauhan
20-Aug-13 6:22am
View
well as far as I am concerned, none of the sites provide free dump.. even if they provide they are not up to the mark...
Adarsh chauhan
20-Aug-13 6:21am
View
Deleted
well as far as I am concerned, none of the sites provide free dump.. even if they provide they are not up to the mark...
Adarsh chauhan
20-Aug-13 6:20am
View
you are right. by mistake I wrote it as this.close() instead of this.Hide()... corrected now..
and about if block, I have written it as if I want to show the second form if textbox value is not blank.. so if block may or may not be used.. it depends on need.. :) any ways thanks for pointing out about this.close(); :)
Adarsh chauhan
16-Aug-13 7:44am
View
Ok, will try once I reach on my machine.
well what I think it should not be affected by conn or con.
Adarsh chauhan
16-Aug-13 5:59am
View
yes.. same username and password,as i have only one user account for my sql server..
Adarsh chauhan
16-Aug-13 5:58am
View
Deleted
yes.. same username and password,as i have only one user account for my sql server..
Adarsh chauhan
16-Aug-13 5:47am
View
:) I don't know if I am missing something.. any help would be appreciated.. :)
Adarsh chauhan
16-Aug-13 5:08am
View
perfect.. +5
Adarsh chauhan
14-Aug-13 8:28am
View
Reason for my vote of 5 \n Nice one and very helpful...
Adarsh chauhan
14-Aug-13 8:12am
View
Reason for my vote of 5 \n Nice and to the point.. :)
Adarsh chauhan
14-Aug-13 6:11am
View
well said Mr. Griff.. +5
Adarsh chauhan
14-Aug-13 1:52am
View
your question is not clear..explain little more..
well you can use case like..
CASE WHEN SUM(isnull(Opening,0))<0 THEN --Do somthing
ELSE --do something
end
Adarsh chauhan
12-Aug-13 7:25am
View
well you forgot to click +5 :)
Adarsh chauhan
12-Aug-13 7:24am
View
nice explanation... +5
Adarsh chauhan
12-Aug-13 7:20am
View
+5 from me also.. :)
Adarsh chauhan
12-Aug-13 7:15am
View
+5
Adarsh chauhan
12-Aug-13 1:42am
View
There is a diff. between getting confused and not knowing at all, and also that no one is perfect in this world. :)
And about your question "how come you became the author of 74 answers?" I would say that I don't post an answer if I don't really know about it.. so you don't need to bother about "possible harm to naive inquirers".
Adarsh chauhan
6-Aug-13 4:49am
View
I agree.. +5
Adarsh chauhan
5-Aug-13 7:19am
View
what logic you are using to convert buyerID as ID..?? I mean how are u converting 0123545 to 1??
Adarsh chauhan
5-Aug-13 3:20am
View
you are most welcome.. :)
Adarsh chauhan
3-Aug-13 7:41am
View
you are most welcome
Adarsh chauhan
2-Aug-13 8:36am
View
ya you are right.. i just told her how we can use return as break... she can use it according to requirement. or can use debug facility :)
Adarsh chauhan
2-Aug-13 8:28am
View
But i didn't get the logic, why you want to do something like this..Don't you think you are making your code complicated?? Maciej has already given nice answer. just a little addition for rowno need to be added to that for your new requirement
Adarsh chauhan
2-Aug-13 8:24am
View
i think you want to do something like this..
insert into #tempfinal
select row_number() over ( order by amount) as [row number],
amount
from #tempcount
group by amount
Adarsh chauhan
2-Aug-13 8:19am
View
nice one.. +5
Adarsh chauhan
2-Aug-13 8:18am
View
I agree.. +5
Adarsh chauhan
2-Aug-13 8:12am
View
+5
Adarsh chauhan
2-Aug-13 7:39am
View
what error is it giving??
Adarsh chauhan
2-Aug-13 7:12am
View
you are most welcome..
Adarsh chauhan
2-Aug-13 6:47am
View
+5
Adarsh chauhan
2-Aug-13 6:45am
View
You are most welcome.. :)
Adarsh chauhan
2-Aug-13 6:44am
View
see my answer. Is it what you are asking for??
Adarsh chauhan
2-Aug-13 6:08am
View
Are you getting an error or it's giving wrong output??
Adarsh chauhan
2-Aug-13 5:44am
View
+5 for the question as I too get confuse about when to use static class, when abstract class and when public class.
Hoping for some nice nice answers/links from experts..
Adarsh chauhan
2-Aug-13 5:40am
View
:O How could I stay unaware about this much important data type...shame on me.. :)
well thanks man, thanks a lot.
Actually I never required to deal with just time so may be that's the reason I was not having any idea about it.. I always deal with data+time so datetime do well for me..
I take my words(sql doesn't have any special data type for time) back :)
Adarsh chauhan
2-Aug-13 5:14am
View
Good one... +5!
Adarsh chauhan
2-Aug-13 5:12am
View
sorry.. I mean special..(I know sql doesn't have any special datatype for time)
Adarsh chauhan
2-Aug-13 4:35am
View
ya i agree... but I said that as I thought he mean that is there any spl. data type like "time" for dealing with time span.. (just my thought)... anyways he'll surely get benefit from your links.. :)
Adarsh chauhan
2-Aug-13 3:31am
View
I agree with Dave. No web service provides data about all insurance provider's data.
you have to rely on insurance provider if they provide you enough required data.
but in case you have database or access to their database you can perform your task by writing methods and piece of code to perform operations on database..
Adarsh chauhan
2-Aug-13 3:22am
View
ya.. it says "how to save timespan in DB" not just "how to save in DB".
Adarsh chauhan
2-Aug-13 3:20am
View
you are most welcome..:)
Adarsh chauhan
2-Aug-13 3:20am
View
Thanks.. :)
Adarsh chauhan
2-Aug-13 3:03am
View
Good One... +5
Adarsh chauhan
2-Aug-13 2:58am
View
aah.. sorry :) here it is..
Adarsh chauhan
2-Aug-13 2:56am
View
+5 for solution
but I didn't get these 3 links..
ADO.NET[^]
ADO.NET Code Examples[^]
ADO.NET Sample Application[^]
they are not explaining anything about timespan.. are they??
Adarsh chauhan
2-Aug-13 2:53am
View
Thanks..
Adarsh chauhan
2-Aug-13 2:52am
View
Perfect, I would also suggest same link (time span) .. :)
+5
Adarsh chauhan
2-Aug-13 2:49am
View
Deleted
Good one, I would also suggest same link.. :)
Adarsh chauhan
2-Aug-13 2:10am
View
+5 !
Adarsh chauhan
2-Aug-13 2:08am
View
provided all the possible solution.. +5 :)
Adarsh chauhan
2-Aug-13 1:44am
View
I agree... as such nothing seems wrong in Apoorva's code. so s/he can try using parametrized query. it will also protect application from sql injection..
+5 Harshil
Adarsh chauhan
2-Aug-13 1:14am
View
Good Links... +5
Adarsh chauhan
1-Aug-13 9:20am
View
nothing seems wrong as such..it should work..
Adarsh chauhan
1-Aug-13 9:06am
View
share your table structure and your query.. only then I can help you out.
Adarsh chauhan
1-Aug-13 8:59am
View
Good Links.. +5
Adarsh chauhan
1-Aug-13 8:44am
View
welcome.. I am happy that your doubt is clear now.. :) cheers..
Adarsh chauhan
1-Aug-13 8:44am
View
Deleted
welcome.. I am happy that your doubt is clear now.. :)
cheers..
Adarsh chauhan
1-Aug-13 8:43am
View
Good answer.. +5
Adarsh chauhan
1-Aug-13 7:28am
View
answer is simple..
because transaction was committed and you are writing delete statement in commited block..you cant rollback a committed transaction..
even if you try
begin transaction
INSERT INTO #employees (FirstName)
SELECT 'Maciej' UNION ALL
SELECT 'Sergey' UNION ALL
SELECT 'Anurag' UNION ALL
SELECT 'Raja' UNION ALL
SELECT 'Richard' UNION ALL
SELECT 'Bernard'
DELETE FROM #employees
SELECT * FROM #employees
rollback transaction
SELECT * FROM #employees
you would not find record in #employee because insert statement is also in rollback..
so try this..
INSERT INTO #employees (FirstName)
SELECT 'Maciej' UNION ALL
SELECT 'Sergey' UNION ALL
SELECT 'Anurag' UNION ALL
SELECT 'Raja' UNION ALL
SELECT 'Richard' UNION ALL
SELECT 'Bernard'
begin transaction
DELETE FROM #employees
SELECT * FROM #employees
rollback transaction
SELECT * FROM #employees
Adarsh chauhan
1-Aug-13 7:15am
View
strange... This question doesn't suits him..
I am surprised after seeing his profile..
Adarsh chauhan
1-Aug-13 7:05am
View
Good answer Raja. +5 for answer. but don't you think question seems like homework..
He should try at his own level and if he finds an error then he should ask for solution.
Adarsh chauhan
1-Aug-13 7:03am
View
what have you tried and where you stuck.
sorry boss but we are here to help each-other, not to do assignments .
Adarsh chauhan
1-Aug-13 6:56am
View
I agree with Gautam It will generate correct query, if your textbox returns values like Single-101,Single-102,Single-103 .
problem must be somewhere else..
Adarsh chauhan
1-Aug-13 6:48am
View
yup it will not achieve harpreet's goal.
it will generate
update roominformation set status ='0' where roomno in 'Single-101,Single-102,Single-103'
Adarsh chauhan
1-Aug-13 6:15am
View
i have updated my query now check
Adarsh chauhan
1-Aug-13 6:13am
View
there are two problems in your query...
1) you have committed your transaction then there is no other transaction to rollback
2)you will face error "Invalid object name '#employees'." if you have not created it.
if you want to use rollback and commit together then it would be condition based..
like..
begin try
begin tran
--- query
commit
end try
begin catch
rollback
Adarsh chauhan
1-Aug-13 5:58am
View
good one.. +5
Adarsh chauhan
1-Aug-13 4:38am
View
you explain really well. :) +5
Adarsh chauhan
1-Aug-13 2:48am
View
set AutoPostBack="False" for dropdownlist
Adarsh chauhan
1-Aug-13 2:45am
View
I think it should be
sql="Select * from Category where PK_CATID is not null"
sql=sql+ 'and CategoryName='+Checkboxeslist.selectedValue
Adarsh chauhan
1-Aug-13 2:28am
View
I agree... Distinct would work for this... and its always better to use alias names for tables when you have to join them.. :) +5
Adarsh chauhan
1-Aug-13 2:23am
View
Thanks.. :)
Adarsh chauhan
1-Aug-13 2:02am
View
ya but it will require more time.. I am asking because some shortcuts are working.
so I thought may be there is any option to make all work..OK, I will reinstall it once I am done with my current project. Till then will manage without shortcuts.. :)
Adarsh chauhan
1-Aug-13 1:47am
View
Hey I have question. I am using SSMSEE 2008 but shortcuts aren't working( for eg. ctrl+n) only F5 is working. Is there any way to make them work??
Adarsh chauhan
1-Aug-13 1:42am
View
I agree.. this can be done in the same stored procedure, no need of a trigger..
first insert records from table X to table Y then update table x.. simple... :)
+5
Adarsh chauhan
1-Aug-13 1:37am
View
Nice to know about "SET TRANSACTION ISOLATION LEVEL READUNCOMMITTED "
was not having any idea about it.. now will Google a little more on this.. +5 :)
Adarsh chauhan
1-Aug-13 1:32am
View
Finally your prob. is solved.. :) Cheers..
Adarsh chauhan
31-Jul-13 8:39am
View
Thanks for your response..:)
Adarsh chauhan
31-Jul-13 8:30am
View
I agree with ryanb31.. nothing seems wrong in your query...
Adarsh chauhan
31-Jul-13 8:24am
View
I agree with Ryanb31...
Adarsh chauhan
31-Jul-13 8:19am
View
@Maciej ...
you are right but I tried npsrajan's query and didn't find any error. It worked fine for me..
create table employee
(
id nvarchar(10),
name Varchar(10)
)
insert into employee values('emp101','Adarsh'),('emp102','Nikhil')
--select * from employee
declare @tmptble TABLE(Col1 nvarchar(10),Col2 numeric(2,0),Col3 numeric(4,0))
insert into @tmptble(Col1,Col2,Col3)
select ID,MONTH(getdate()),YEAR(getdate()) from Employee
select * from @tmptble
Output:
Col1 Col2 Col3
emp101 7 2013
emp102 7 2013
so i have a doubt that why its giving error at his side and not on my side.. any idea??
Adarsh chauhan
31-Jul-13 7:55am
View
Exact and To the point explanation. +5
Adarsh chauhan
31-Jul-13 7:49am
View
Nice answer.. +5
Adarsh chauhan
31-Jul-13 7:27am
View
i tried this code in C# and its working fine in my case..
protected void Page_Load(object sender, EventArgs e)
{
showmsg();
}
public void showmsg()
{
string body = string.Empty;
SqlConnection conn = new SqlConnection(con.getConnection());
conn.Open();
SqlCommand cmd = new SqlCommand();
cmd.CommandText = "select * from temp";
cmd.Connection=conn;
SqlDataReader dr = cmd.ExecuteReader();
if (dr.HasRows)
while (dr.Read())
body = body + "---------------------------------" + Environment.NewLine + "Part Number: " + dr["PartNumber"].ToString() + Environment.NewLine + "Description: " + dr["Description"].ToString() + Environment.NewLine + Environment.NewLine + "Current Stock: " + dr["CurrentStock"].ToString() + Environment.NewLine + "Minimum Required: " + dr["MinimumRequired"].ToString() + Environment.NewLine;
Response.Write(body);
}
cant say about VB.
try after replacing & to +
Adarsh chauhan
31-Jul-13 7:27am
View
Deleted
i tried this code in C# and its working fine in my case..
protected void Page_Load(object sender, EventArgs e)
{
showmsg();
}
public void showmsg()
{
string body = string.Empty;
SqlConnection conn = new SqlConnection(con.getConnection());
conn.Open();
SqlCommand cmd = new SqlCommand();
cmd.CommandText = "select * from temp";
cmd.Connection=conn;
SqlDataReader dr = cmd.ExecuteReader();
if (dr.HasRows)
while (dr.Read())
body = body + "---------------------------------" + Environment.NewLine + "Part Number: " + dr["PartNumber"].ToString() + Environment.NewLine + "Description: " + dr["Description"].ToString() + Environment.NewLine + Environment.NewLine + "Current Stock: " + dr["CurrentStock"].ToString() + Environment.NewLine + "Minimum Required: " + dr["MinimumRequired"].ToString() + Environment.NewLine;
Response.Write(body);
}
cant say about VB.
try after replacing & to +
Adarsh chauhan
31-Jul-13 7:02am
View
Try this..
replace your while loop code with
body = body + "---------------------------------" + Environment.NewLine + "Part Number: " + reader2["PartNumber"].tostring() + Environment.NewLine + "Description: " + reader2["Description"].tostring() + Environment.NewLine + Environment.NewLine + "Current Stock: " + reader2["CurrentStock"].tostring() & Environment.NewLine + "Minimum Required: " + reader2["MinimumRequired"].tostring() & Environment.NewLine
Adarsh chauhan
31-Jul-13 6:58am
View
Deleted
try this in your while
body = body + "---------------------------------" + Environment.NewLine + "Part Number: " + reader2["PartNumber"].tostring() + Environment.NewLine + "Description: " + reader2["Description"].tostring() + Environment.NewLine + Environment.NewLine + "Current Stock: " + reader2["CurrentStock"].tostring() & Environment.NewLine + "Minimum Required: " + reader2["MinimumRequired"].tostring() & Environment.NewLine
Adarsh chauhan
31-Jul-13 6:31am
View
share your piece of code where your are converting...
and also change datatype in your table structure.
Adarsh chauhan
31-Jul-13 6:25am
View
have you changed datatype in your database??
when this error is coming???
Adarsh chauhan
31-Jul-13 6:17am
View
if your stock is in no. of pieces then you can set it to int else decimal.
I would suggest you to go for decimal as stock can be in length, weight or no. of pieces etc. so int would work right for no. of pieces only..
Adarsh chauhan
31-Jul-13 5:11am
View
even I am waiting for your problem to be solved, as I am being curious about how it would be done??
Adarsh chauhan
31-Jul-13 5:03am
View
Nice link... my vote of 5
Adarsh chauhan
31-Jul-13 4:59am
View
Thanks RK.. and sorry I have no solution for your updated question as I have never tried to import data from mysql to sql server where columns are different.
And if you find the solution for your updated question please do share it will us so that in future if anyone face the same prob. s/he can take help from your answer.
Adarsh chauhan
31-Jul-13 4:58am
View
Deleted
Well if you will find the solution for your updated question please do share it will us so that in future if anyone face the same prob. s/he can take help from your answer.
Adarsh chauhan
31-Jul-13 2:58am
View
Deleted
Thanks RK.. and sorry I have no solution for your updated question as I have never tried to import data from mysql to sql server where columns are different.
Adarsh chauhan
31-Jul-13 2:26am
View
Thanks :)
Adarsh chauhan
31-Jul-13 2:25am
View
:) Thanks. I find it better then writing same answer again and again.. and FYI I have learned this technique from you only. In my past days i used to write answers again and again.. :)
Adarsh chauhan
31-Jul-13 1:29am
View
Nice and to the point explanation.. +5
Adarsh chauhan
30-Jul-13 6:07am
View
you are most welcome..
Adarsh chauhan
30-Jul-13 5:19am
View
you are most welcome.. :)
Adarsh chauhan
30-Jul-13 2:42am
View
Nice.. +5
Adarsh chauhan
30-Jul-13 2:00am
View
Thanks Ridoy.
without knowing the exact table structure and code we can't exactly say which column is causing this error, so only answer could be " check all columns in your table and supplied data" or we can make only guesses
:)
Adarsh chauhan
30-Jul-13 1:59am
View
I agree... This is the correct answer..This type of error comes when you try to insert long size data in lesser capacity column.
without knowing the exact table structure and code we can't exactly say which column is causing this error, so only answer could be " check all columns in your table and supplied data" or we can make only guesses. so +5 from my side also..
Adarsh chauhan
29-Jul-13 7:50am
View
Thanks again :)
Adarsh chauhan
29-Jul-13 7:47am
View
Thanks for the tip Raja.. I really didn't know that.. Thanks for sharing it...
Adarsh chauhan
29-Jul-13 7:34am
View
I agree with Maimonides... Check all your columns datatype..
well, i have doubt in " Blood_Group='Select' "
see what length you have given for this.. I am saying because if i would design table then I will choose char(3) to store like 'B+','AB+', and in this case 'select' cant be stores in that column.
Adarsh chauhan
29-Jul-13 5:12am
View
Can you provide your tables in create mode?? it will save my time as well as there would not be mismatch in datatypes between yours and my tables.
also tell me that is the relationship between your tables is the station column??
and your "Need to get LINE_NO@TX_STATION_STATUS from TESTER_ID@TX_CR_QTY_BUILD.." is still not clear to me..
Adarsh chauhan
29-Jul-13 5:08am
View
Thanks...
and ya you are right first line should be Use DatabaseName;
but I skipped that because i thought that it is understood...
added now.. Thanks for reminding :)
Adarsh chauhan
29-Jul-13 4:35am
View
Please share your table structure, relation between them and your goal.
So that we can help you with an answer. without enough info. we can only hit and try on your query, which may or may not be correct answer for you.
Adarsh chauhan
29-Jul-13 4:28am
View
sorry but your question is not clear to me... what do you mean by
"i have some record with same TicketID and i don't want to display just one row"??
if prob. is with duplicate records then you can use Distinct.. else please explain your prob.
Adarsh chauhan
29-Jul-13 3:19am
View
Nice explanation.
+5
Adarsh chauhan
25-Jul-13 6:40am
View
Very useful and informative links...
I read most of links posted by you people just to find something new and I am happy that every time I access a link i learn something new... :)
Thanks to you people and codeproject.com .. :)
+5
Adarsh chauhan
25-Jul-13 6:15am
View
Please share your code and stored proc. so that we can find out where the problem actually is.
without enough information it would be just hit and trial for us.
there may be n no. of reasons for SP running slow..
Adarsh chauhan
25-Jul-13 2:37am
View
I agree... using parameters instead of string concatenation is always better and secure way...
Nice and helpful links.. +5
Adarsh chauhan
24-Jul-13 7:36am
View
ya you are right.. sorry my sentence conveyed wrong message.. by that didn't mean that they will be on same time.. i was asking that whether id will be returned session wise or table wise...
Adarsh chauhan
24-Jul-13 7:34am
View
yup you are right.. there will b diff. b/w both transaction..
but i was confused that @@identity or Scope_Identity will return the max id from the table as ident_current does..
now there is no confusion.. as @@identity or Scope_Identity work on session wise...
Thanks again..
Adarsh chauhan
24-Jul-13 7:31am
View
Thanks a lot, I got my answer..
I used all the cases...
select case(which i was using),@@Identity and Scope_identity() is working fine for me... but Ident_current() would not work right in my case..
Thanks for help... :)
Adarsh chauhan
24-Jul-13 7:29am
View
thanks for your response.. I used all the cases...
select case,@@Identity and Scope_identity() is working fine for me... but Ident_current() will not work right in my case... I got the answer...
and about performance wise i cant say as right now my app is in development phase data is not huge enough to test performance... Thanks alot
Adarsh chauhan
24-Jul-13 7:10am
View
thats fine i will use Top 1 order by desc... this will do my task..
but my question is...
(select Top 1 TenantId from TenantDetails(nolock) where Createdby= @createdby Order by TenantId desc) would be better in my case or @@IDENTITY, SCOPE_IDENTITY, and IDENT_CURRENT will work right ??
Adarsh chauhan
24-Jul-13 7:06am
View
Thanks Maciej ...
I already gone through this link.. but my question is a bit different...
I mean there are two users let's say A and B
both are using same page...
both will insert records... at the same time SP usp_AddTenant will be called...
so if i use @@IDENTITY or scope_identity... it should not provide the id of last inserted id of record inserted by other user...
if it does that wrong room no will get assigned to tenant...
so should i use (select Max(TenantId) from TenantDetails(nolock) where Createdby= @createdby) in my case..?? or @@IDENTITY, SCOPE_IDENTITY, and IDENT_CURRENT will work right for my case??
Adarsh chauhan
24-Jul-13 7:00am
View
that is not a prob. if i use where Createdby= @createdby i will get the desired output...
i mean if i dont use where clause..
like suppose at the same time two users are using same app. respectively ids generated are 1,2 i dont want it to happen that id generated by 1st user's trans. returned to 2nd or vise versa..
Adarsh chauhan
24-Jul-13 3:38am
View
nice one... :) +5
Adarsh chauhan
24-Jul-13 3:37am
View
Really good one... +5
Adarsh chauhan
18-Jul-13 4:44am
View
+5
Adarsh chauhan
17-Jul-13 7:56am
View
Thanks Raja sekhar...
Problem was in code( where i was passing output parameter in c# code)
.. any ways thanks for your response..
Adarsh chauhan
17-Jul-13 7:47am
View
forgot to write.. i have already mentioned it as output parameter in sp..
i m improving my question.. wait...
Adarsh chauhan
12-Jul-13 5:48am
View
sorry your question is not clear...
Adarsh chauhan
10-Jul-13 6:09am
View
No its not necessary to write 'go'.
GO is used to signal the end of a batch.
GO is not a Transact-SQL statement; it is a command recognized by the sqlcmd and osql utilities and SQL Server Management Studio Code editor.
Adarsh chauhan
10-Jul-13 3:26am
View
can also use like..
select ISNULL(nullif(Factor1,''),'0.00') as BrokerageAmt from podtl where DocCode='FY13/PO/33'
Adarsh chauhan
10-Jul-13 3:21am
View
perfect and better then mine..
+5 for this..
I learned use of coalese and nullif.. Thanks
Adarsh chauhan
10-Jul-13 2:43am
View
Thanks.. you are most welcome...
I also learned a lot from code project, and you peoples...
:)
Adarsh chauhan
10-Jul-13 1:17am
View
what you exactly want to do?? sorry not able to understand your question..
Please make it clear.
Adarsh chauhan
9-Jul-13 7:28am
View
+5 Nirav.. nice one
Adarsh chauhan
9-Jul-13 5:58am
View
can you Provide your table structure, and also explain what you want to achieve?
can't say about others but i am having little doubt in your logic used.
well in your case you have missed 'end' keyword..
case when P.Factor1=' ' then 0 else P.Factor1 End as BrookerageAmt
from pr.PODTL P where FkItemCode=D.FkItemCode and DocCode=@ParentDocCode
Adarsh chauhan
9-Jul-13 5:45am
View
hmm.. That's what i was asking... Thanks a ton... got my answer..
Adarsh chauhan
9-Jul-13 5:37am
View
sorry boss then have no idea....
if you don't keep a regular backup then its a bad luck... :(
Adarsh chauhan
9-Jul-13 5:35am
View
i already gone through the link.. but my question is that if i install SqlServer on desktop and laptop both using same CD. then??? it would be same version.. no???
Adarsh chauhan
9-Jul-13 5:17am
View
Hi Macial Los ..
I was not knowing that "Versions of MS SQL server on laptop and desktop computer are not the same."
Thanks for mentioning..
i would like clear my confusion,so can you tell me that do you mean "sql server 2008r2 on desktop" and "sql server 2008r2 on laptop" would not be same, even if i am installing from same setup file???
waiting for your response..
would be better if you provide any link which states little more on the same topic..
Adarsh chauhan
9-Jul-13 4:17am
View
really helpful
+5
Adarsh chauhan
9-Jul-13 2:44am
View
Deleted
do you mean you want to transfer data base objects from one database to another???
Adarsh chauhan
9-Jul-13 1:50am
View
you are most welcome.. :)
Adarsh chauhan
8-Jul-13 6:40am
View
forgot to click.. now you can see that.. :)
Adarsh chauhan
8-Jul-13 6:38am
View
what is the actual problem you are facing??
you have provided your sql query but not you have not explained that what prob. you are facing. please provide your table structure if possible..
Adarsh chauhan
8-Jul-13 6:28am
View
I agree with you, logic used is really very confusing... one value will be true for multiple conditions....
+5 for answer
Adarsh chauhan
8-Jul-13 5:45am
View
thanks.. :)
Adarsh chauhan
8-Jul-13 5:23am
View
If you got any other way then please share, it will help me if someday I have to perform same task in different way...
Adarsh chauhan
8-Jul-13 4:26am
View
I found this the shortest and easiest way to accomplish your motive..
Although there may be some other ways too but that's how I would be doing this..
Adarsh chauhan
8-Jul-13 4:17am
View
Please share your code, only then we can tell you where you are going wrong.
Without seeing your code we can only make guesses..
Adarsh chauhan
8-Jul-13 1:07am
View
you are most welcome buddy... and ya I have written this code in MS sql server.
Adarsh chauhan
5-Jul-13 8:39am
View
Deleted
Have you stored names with '' in table???
Adarsh chauhan
5-Jul-13 8:37am
View
ya you are right user has not mentioned any datatype, but just said because it is but obvious that when we talk about leavefrom and leave to we talk about days.
above will work with numeric data.
I didn't mean to be rude..
Adarsh chauhan
5-Jul-13 8:24am
View
sorry to say but It would give wrong output as you can see that dtleavefrom and dtleaveto must be date.
Adarsh chauhan
5-Jul-13 7:58am
View
what do you mean by " i want to check all the values whether it's null or not and select only those values which are not null"
both cases are different. please clarify what you want to achieve and if possible provide your table and sample data
Adarsh chauhan
5-Jul-13 6:54am
View
you are most welcome...I am happy that your prob. is solved.
Adarsh chauhan
5-Jul-13 6:38am
View
see the posted answer.
Is it what you want to do???
Adarsh chauhan
5-Jul-13 6:06am
View
your table doesn't have any column as 'state' is it any computed result or you are referring to account column as state?? Also tell me one thing do you mean a query like select * from abc where authority='NEVEDA'???
and if you want to save account as 123456.4-23 then why are you taking the column as int???
Adarsh chauhan
5-Jul-13 5:32am
View
your stored procedures take 13 input parameters
(
@PointId bigint,
@emrClientId char(25),
@RegisteredOn datetime,
@LastUpdated datetime,
@NewAcceptorDate datetime,
@CurrentMethod char(25),
@Dob datetime,
@DobType char(10),
@PregnanciesDemo1 smallint,
@ChildrenDemo2 smallint,
@AbortionsDemo3 smallint,
@EducationDemo4 smallint,
@Sex smallint,
) but you are passing about 36 (see your "theCmd.Parameters.AddWithValue" statements) . thats why it is giving exception. Pass only the required parameters and your prob. will be solved.
and to make sure that this is the prob. execute your sp in sql server with inputs.. and you will be sure that its the prob.
Adarsh chauhan
5-Jul-13 3:24am
View
doesn't look like there is any error with SP 'IMS_NB_EMRUP_Client_Insert'.
I agree with Tadit and jaideep, debug your code to find out the exact problem.
Adarsh chauhan
5-Jul-13 2:54am
View
Can't say about others but your question is not clear to me.. could you please explain a bit clearly what exactly you want to achieve??
Adarsh chauhan
5-Jul-13 2:44am
View
links you provided are really very helpful.. nicely explained.. +5 for providing these links.
Adarsh chauhan
4-Jul-13 6:42am
View
Please Provide your table in create mode and sample data so that we can help you.
Adarsh chauhan
4-Jul-13 4:27am
View
link is really nice... very helpful
Adarsh chauhan
4-Jul-13 1:24am
View
Hi Zukiari,
your solution will work in case if data is being updated/inserted using some GUI as you can capture login id and save that in table as modified by. But what if user is updating table records using sql queries?? as you cant assume user will always pass his correct info.. is there any way to find it using any sql functionality(any built in func or sp)?? I dont have any clue about it so just asking...
Adarsh chauhan
2-Jul-13 7:52am
View
Hi,
Can you please provide your tables and sample data/scenario. It will help us to understand and we would be able to help you out.
Adarsh chauhan
2-Jul-13 3:07am
View
m happy that it worked for you.. :)
but m having a doubt.. can you please tell me that how will you get that whthr u have to select top 3 or 4 on n no. of rows???
would not it be btr if you do it like this...( in case if you are bothered about trans_desc only)
select Referance,trans_date,trans_desc,sum(Debit) Total_Debit from LGR
where trans_desc=182
group by Referance,trans_date,trans_desc
Adarsh chauhan
2-Jul-13 2:32am
View
Do you mean this...
select Referance,trans_date,trans_desc,sum(Debit) Total_Debit from
(
SELECT TOP 3 * FROM LGR ORDER BY TRANS_NO DESC
)tbl1
group by Referance,trans_date,trans_desc
Adarsh chauhan
1-Jul-13 1:59am
View
No buddy.. that's not possible.. you can have only one identity column per table..
Adarsh chauhan
28-Jun-13 5:58am
View
welcome.. :)
Adarsh chauhan
25-Jun-13 7:24am
View
sorry to say but i looks like you have not tried at your own level.you could get the answer simply by goggling...
Adarsh chauhan
25-Jun-13 7:14am
View
Nice and easy one.... :) +5 gvprabu
Adarsh chauhan
25-Jun-13 7:06am
View
welcome buddy :)
Adarsh chauhan
25-Jun-13 1:03am
View
create proc sp_test
as
declare @column nvarchar(50)
set @column= (SELECT COLUMN_NAME +',' FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'machine' AND TABLE_SCHEMA='dbo' and COLUMN_NAME !='mid'
FOR XML PATH('')) declare @query nvarchar(max)
set @column= LEFT(@column,LEN(@column)-1)// this will remove the, from the last and ur prob. will be solved
set @query = 'select distinct '+@column+' from machine'
Adarsh chauhan
15-May-13 8:03am
View
can you please provide code which you are using. so that it will be clear, where actually the problem is.
Adarsh chauhan
14-May-13 7:48am
View
thanks Maciej Los
Adarsh chauhan
10-Mar-13 4:07am
View
Thanks Edo...
My requirement is just to do it through JavaScript. I don't want to use Flash or SilverLight.
I want It to be drawn by using basic drawing techniques, or using system.drawing{}
Show More