Click here to Skip to main content
14,578,463 members

Comments by nagendrathecoder (Top 200 by date)

nagendrathecoder 29-Dec-16 4:47am View
Can you explain your question a bit more.
What exactly you want to insert into SQL? A record in some table?
nagendrathecoder 12-Mar-15 8:07am View
So what's the problem? You can get examples for reading and writing to xml files from google.
nagendrathecoder 3-Mar-15 22:51pm View
Hi Dave,
I am also working on code first approach and have similar structure as OP mentioned but i did not received such error. Below is an example of how i am defining my data:

public partial class State
public int StateId { get; set; }

public string Name { get; set; }

public string ShortName { get; set; }

public virtual ICollection<city> Cities { get; set; }

public partial class City
public int CityId { get; set; }

public string Name { get; set; }

public string ShortName { get; set; }

public int StateId { get; set; }

public virtual State State { get; set; }

Now suppose i removed int StateId from City class, EF will still add foreign key column of StateId in city table.
But while inserting into city, how i will be able to insert value for stateId?
Do i have to populate the Virtual State property? If yes then will it be a bit time consuming?
nagendrathecoder 25-Feb-15 22:23pm View
It is not clear. Can you tell how you like to store strings in array after splitting?
nagendrathecoder 25-Feb-15 4:18am View
Do we have to guess the errors?
nagendrathecoder 17-Feb-15 23:30pm View
Better check google or some book.
nagendrathecoder 13-Feb-15 0:20am View
Why are you answering a question which has an accepted answer more then a year ago.
nagendrathecoder 9-Feb-15 5:05am View
Match all column names and use same column names as defined in stored procedure.
nagendrathecoder 9-Feb-15 5:05am View
Match all column names and use same column names as defined in stored procedure.
nagendrathecoder 9-Feb-15 4:53am View
There you go.
You have EmpId field in SP and you are fetching Id field.
nagendrathecoder 9-Feb-15 4:44am View
Check executing SPGETEMPLOYEE stored procedure in SQL server mgmt studio and verify the result. Check is the result showing all columns you are trying to fetch properly or not.
nagendrathecoder 9-Feb-15 4:31am View
What is the error?
nagendrathecoder 5-Feb-15 8:55am View
This is a vague question. Explain your question in better way.
What have you tried so far?
nagendrathecoder 5-Feb-15 5:41am View
Check google.
nagendrathecoder 5-Feb-15 5:25am View
nagendrathecoder 5-Feb-15 3:14am View
Have you looked in google?
nagendrathecoder 5-Feb-15 2:25am View
You could have googled for it.
nagendrathecoder 5-Feb-15 2:24am View
Do not spam here
nagendrathecoder 4-Feb-15 6:47am View
Do not spam here
nagendrathecoder 4-Feb-15 5:09am View
Yes, that is rite, it can be done with <=
nagendrathecoder 4-Feb-15 5:08am View
Yes, that is rite, it can be done with <=
nagendrathecoder 4-Feb-15 4:48am View
But suppose if your condition results in false then X may be equal to Y rite.
So to check if it is also not equal, 2nd condition is needed.
nagendrathecoder 4-Feb-15 4:46am View
Correct but if X is not greater than Y then it may be equal to Y.
So second check for not equal is also required.
nagendrathecoder 4-Feb-15 4:14am View
You could have checked google.
nagendrathecoder 27-Jan-15 9:01am View
nagendrathecoder 27-Jan-15 7:19am View
This must be returning some class object.
Use classobject.Lineno property.
For e.g: AncillariesList[AncillariesList.Count - 1].Lineno;
nagendrathecoder 27-Jan-15 7:07am View
Are those 20 values so far in that list are in increasing order or in random sequence?
nagendrathecoder 27-Jan-15 4:31am View
We generally fire a validation on sumbit click.
Is there any specific reason you want validation to fire as soon as list is populated?
nagendrathecoder 27-Jan-15 4:12am View
Your question is not clear. Please it a bit more.
nagendrathecoder 27-Jan-15 4:10am View
Yes you are right.
nagendrathecoder 23-Jan-15 2:08am View
You can do something like this:
Session["Varialble_Name"] = Your_selected_value;

On next page while retrieving session:
string selectedValue = Convert.ToString(Session["Variable_Name"]);
nagendrathecoder 22-Jan-15 8:19am View
Not clear. Can you explain a bit more?
nagendrathecoder 22-Jan-15 8:10am View
Has google stopped working?
nagendrathecoder 22-Jan-15 7:45am View
The link i have provided has some sample programs, you can refer those.
nagendrathecoder 22-Jan-15 6:04am View
You forgot to mention the error.
nagendrathecoder 22-Jan-15 5:14am View
No one will provide you code here.
You have to try it yourself and if you face any problem or issue then everyone will help you.
nagendrathecoder 22-Jan-15 2:59am View
Check the syntax of post method. Refer to the solution provided.
nagendrathecoder 22-Jan-15 2:51am View
And what are those errors?
nagendrathecoder 22-Jan-15 2:34am View
How can you identify this without storing year? It can be anything.
nagendrathecoder 21-Jan-15 10:12am View
And what is that bug and its location?
nagendrathecoder 7-Jan-15 9:48am View
You welcome. :)
nagendrathecoder 7-Jan-15 7:14am View
Please refer the link which i provided in solutions. It will answer most of your questions.
nagendrathecoder 7-Jan-15 7:11am View
So this is assignment for you and you have to solve it rather then us.
If you getting any errors we can help you but no one would be interested in doing your homework.
nagendrathecoder 7-Jan-15 7:05am View
What problems you are facing while implementing this interface? Please explain you question. Is this some homework or assignment?
nagendrathecoder 7-Jan-15 7:02am View
Your question is not clear, please explain more.
Also what have you tried and what problems you are facing?
nagendrathecoder 7-Jan-15 7:00am View
What problems you are facing while implementing this interface? Please explain you question. Is this some homework or assignment?
nagendrathecoder 22-Oct-12 2:41am View
Reason for my vote of 1
Just a code snippet without any explanation.
nagendrathecoder 18-Oct-12 2:42am View
Nobody is going to give you code for that.
Tell us what have you done so far and what problems you are facing, you will only get help for that.
nagendrathecoder 28-Sep-12 5:46am View
You cannot convert string like "sid" to an integer, not even in imagination.
nagendrathecoder 1-Jun-12 3:32am View
Oh achcha hehe
nagendrathecoder 1-Jun-12 3:00am View
same here. more quicker mhanje?
nagendrathecoder 1-Jun-12 2:55am View
Not clear, please explain more.
nagendrathecoder 17-May-12 11:17am View
What have you tried so far?
nagendrathecoder 14-May-12 3:00am View
I got that myself, thanks. :)
nagendrathecoder 11-May-12 9:17am View
select * from t1,t2 will do a cross join which i guess is not the result OP is expected.
Second query is correct one.
nagendrathecoder 11-May-12 9:05am View
nagendrathecoder 10-May-12 9:05am View
nagendrathecoder 10-May-12 8:57am View
Please explain a bit, give some code snippet if you can.
nagendrathecoder 10-May-12 1:19am View
Thanks :)
nagendrathecoder 9-May-12 6:44am View
Interview question
nagendrathecoder 9-May-12 6:43am View
Seems to be an interview question.
nagendrathecoder 2-May-12 8:07am View
Your question is not clear, please explain a bit.
nagendrathecoder 30-Apr-12 6:19am View
pass a variable in place of actual value.
nagendrathecoder 30-Apr-12 5:59am View
So what exactly do you need?
You have to where clause in your queries to fetch single record.
nagendrathecoder 25-Apr-12 5:41am View
Your database name is different in 2nd connection string.
nagendrathecoder 18-Apr-12 2:52am View
Oh it was you only who asked the question. :D
Then its ok, ignore my previous comment. :)
nagendrathecoder 18-Apr-12 2:50am View
Your answer is correct but IMO we should not spoonfeed people with readymade code snippets. We can provide them a link from where they can learn it.
nagendrathecoder 17-Apr-12 2:55am View
What is the question? you forgot to mention one.
nagendrathecoder 13-Apr-12 7:42am View
What operations you are doing with textbox. If this error is coming then textbox is already validated.
nagendrathecoder 13-Apr-12 7:42am View
What operations you are doing with textbox.
If this error is coming then textbox is already validated.
nagendrathecoder 13-Apr-12 7:03am View
What have you tried so far?
nagendrathecoder 10-Apr-12 6:16am View
Where you got struck? Are you getting any error?
nagendrathecoder 5-Apr-12 4:46am View
Go Google.
nagendrathecoder 2-Apr-12 6:33am View
Why such requirement? Are you planning to spam these sites?
nagendrathecoder 31-Mar-12 6:46am View
Yeah you are right. :)
nagendrathecoder 31-Mar-12 6:32am View
Please explain a bit more.
nagendrathecoder 31-Mar-12 6:00am View
Tell us how you are making setup? Are you using Visual Studio Setup project or and other third party installer?
nagendrathecoder 21-Mar-12 8:40am View
I would say why wait for the exceptions.....handle validations.
nagendrathecoder 21-Mar-12 7:46am View
This way same message will be displayed for all exceptions.
nagendrathecoder 20-Mar-12 2:30am View
can you show us some more code? format of the data coming into datareader.
nagendrathecoder 19-Mar-12 10:46am View
nagendrathecoder 14-Mar-12 8:36am View
yes, just supply this value to File.Create() method after adding some directory name to filename e.g c:\hello.txt.
nagendrathecoder 14-Mar-12 8:36am View
yes, just supply this value to File.Create() method after adding some directory name to filename e.g c:\hello.txt.
nagendrathecoder 14-Mar-12 8:16am View
check the link in my updated answer. You can use File.Create method to create a file.
nagendrathecoder 14-Mar-12 8:08am View
This won't create a file. OP wants to create and write file.
nagendrathecoder 14-Mar-12 7:56am View
Check my updated solution. You can use File.Create() method to create a file.
nagendrathecoder 14-Mar-12 7:53am View
check my updated solution,
nagendrathecoder 13-Mar-12 3:18am View
Nice answer.
nagendrathecoder 13-Mar-12 3:17am View
Check Rahul Rajat Singh answer. It is good.
nagendrathecoder 13-Mar-12 2:44am View
Check my answer
nagendrathecoder 13-Mar-12 2:14am View
Can you tell me the structure of each line?
nagendrathecoder 12-Mar-12 5:49am View
You can't get that. Image stored in sql table doesn't have any reference with folder path or name.
Why do you need folder name or path anyway?
nagendrathecoder 12-Mar-12 3:26am View
Can you show us some code of reading file or structure of file and array.
nagendrathecoder 7-Mar-12 6:43am View
I didn't got you. Whats total gross salary?
nagendrathecoder 7-Mar-12 6:35am View
Not possible.
nagendrathecoder 7-Mar-12 6:32am View
so sorry, i thought it is a web application.
Just call getdata() at the end of button_click event.
nagendrathecoder 24-Feb-12 4:23am View
Your question is not clear. Can you explain it more?
nagendrathecoder 29-Dec-11 4:13am View
use this--> " + Convert.ToInt32(dr("SAVINGS")) + "
nagendrathecoder 29-Dec-11 4:13am View
use this--> " + Convert.ToInt32(dr("SAVINGS")) + "
nagendrathecoder 29-Dec-11 2:26am View
Thats what the code will do.
It will convert null value to 0 at the time of inserting.
nagendrathecoder 29-Dec-11 2:03am View
How are you inserting data from gridview, please show us some code.
nagendrathecoder 29-Dec-11 1:54am View
Only if all of them are in same group. If we keep radio buttons in different groups then more than 1 can be selected.
nagendrathecoder 29-Dec-11 1:49am View
Reason for my vote of 5
Nice tip
nagendrathecoder 29-Dec-11 1:30am View
No need to use ViewState or SessionState, declare your DataTable object at class level.
nagendrathecoder 28-Dec-11 6:53am View
Can you show us your SP?
nagendrathecoder 28-Dec-11 6:21am View
I guess this won't solve OP's problem.
It'll always show only current record in gridview coz this code will execute on button click.
nagendrathecoder 28-Dec-11 5:07am View
Here we try not to spoonfeed anyone.
Learn the art of googleing, it'll help u in future.
nagendrathecoder 28-Dec-11 4:59am View
Ha ha ha ha.......very funny.
Don't try to be too smart, you are not.
Editting a question doesn't remove its previous contents, check the previous revisions.
nagendrathecoder 28-Dec-11 4:39am View
Visit some placement consultancy, you'll find many candidates.
nagendrathecoder 28-Dec-11 4:23am View
Then what for it is?
nagendrathecoder 28-Dec-11 4:14am View
This is not the site for advertising.
nagendrathecoder 28-Dec-11 0:51am View
using JOINs is much better option than writting plain queries.
nagendrathecoder 28-Dec-11 0:43am View
What is the exception?
nagendrathecoder 5-Dec-11 8:23am View
Search google.
nagendrathecoder 1-Dec-11 6:00am View
You welcome. Mark it as answer if this solves your problem.
nagendrathecoder 1-Dec-11 5:59am View
So whats the problem in that? Do you want to allow multiple logins using same username and password?
nagendrathecoder 1-Dec-11 5:52am View
What error are you getting?
I tried it and i am getting perfect results.
nagendrathecoder 1-Dec-11 5:48am View
Check my other solution, hope it'll solve ur problem.
nagendrathecoder 1-Dec-11 5:20am View
But in your program, you are converting to string and then adding it to count, which means count variable has to be string.
Please clear me what are you intends to do then i can guide you.
nagendrathecoder 1-Dec-11 5:14am View
Thats why i asked you whether count is string or integer?
in the above case (a and b), if a and b are integers then both equations will be same. But if a and b are string then both quations will produce different result.
nagendrathecoder 1-Dec-11 4:52am View
What is count? is it a string variable?
try this:
count = count + yy;
nagendrathecoder 1-Dec-11 4:33am View
Do you want to add those integers or make a string of those numbers?
Take that string yy outside FOR loop.
nagendrathecoder 1-Dec-11 4:10am View
What have you tried so far?
What you are asking is very basic thing, search google.
If you got stuck anywhere while implementing then come here.
nagendrathecoder 15-Nov-11 7:05am View
Debug and check the answer.
nagendrathecoder 15-Nov-11 5:44am View
You can update your question, no need to post another question for same topic.
nagendrathecoder 12-Nov-11 2:01am View
I have Visual Studio 2005, thats why i want to know whether these supports 2.0 or beyond that.
nagendrathecoder 5-Nov-11 2:58am View
Do you want to save image into database or what? your question is not too clear, please tell us more about it.
nagendrathecoder 4-Nov-11 8:14am View
AFAIK we pass instance name of sqlserver to connection string.
Is it not working like that?
nagendrathecoder 4-Nov-11 1:25am View
Use question heading related to actual topic.
nagendrathecoder 4-Nov-11 1:12am View
There is a limit of 64 handles given by MSDN.
Please check Remarks section in this link
I agree with your other points.
I am sure there must be a better way of doing this, i am also keen to know those and waiting for other alternatives. :)
nagendrathecoder 23-Oct-11 6:29am View
Can i use this code and create 1000s of threads and will those execute symoltaneously.
nagendrathecoder 23-Oct-11 6:28am View
No i am not .Net 4 but will bookmark this answer for future purpose.
nagendrathecoder 23-Oct-11 5:47am View
Creating a user means to create a database entry for that user, create a AD entry for that user and finally create a Exchange Mailbox entry for that user.
It generally takes upto 20 sec to create a user which is completely acceptable time.
My aim is to try and create more users at same time frame, so that 4-5 users gets created in 20 sec time frame.
I am calling method of a webservice to add user.
I am tring to create threads to do symoltaneous entry but only 1 thread at a time is processing.
nagendrathecoder 23-Oct-11 4:45am View
I compared the timmings for each operation, reading lines is not taking time. Time is taking while processing Add method.
From a log file, i observed that only one thread at a time is processing in Add method.
In Add method, i am creating users, this normally takes around 20 sec to create a user.
In log file, every user is getting created after a gap of around 15-20 sec.
I want to know is this somehow possible that say 5 threads process Add method symoltaneously and in a period of 15-20 sec these 5 users gets created.
nagendrathecoder 22-Oct-11 9:13am View
Search google.
nagendrathecoder 10-Oct-11 7:32am View
Nice link, thanks.
nagendrathecoder 4-Oct-11 8:21am View
Are you getting any error in this code?
Why are you putting rbtn.Checked in if condition? This way u won't get false value.
nagendrathecoder 4-Oct-11 8:08am View
You need to loop through all rows of gridview and find radio button control on each row.
Then you can use Checked property of radio button on each row to save yes or no.
nagendrathecoder 4-Oct-11 3:10am View
IMO, we should let OP learn things by providing them some links rather than providing answers for these simple tasks.
nagendrathecoder 4-Oct-11 3:04am View
So what is the problem? What have you tried?
nagendrathecoder 4-Oct-11 3:03am View
Please show us some code snippet
nagendrathecoder 3-Oct-11 7:56am View
Mention what error you are getting.
nagendrathecoder 30-Sep-11 1:43am View
Your question is not clear.
Plz explain your question a bit.
nagendrathecoder 20-Sep-11 6:05am View
What do your mean by "only in single table"??
nagendrathecoder 20-Sep-11 5:46am View
Search google
nagendrathecoder 20-Sep-11 5:45am View
Awesome :D
nagendrathecoder 20-Sep-11 5:27am View
Answer is wrong and the syntax of statement is also wrong.
You are fetching count as a string and assigning it to int.
nagendrathecoder 20-Sep-11 5:20am View
good answer
nagendrathecoder 20-Sep-11 5:20am View
good answer
nagendrathecoder 14-Sep-11 4:25am View
Provide some details or some code snippet which u tried.
nagendrathecoder 8-Sep-11 8:59am View
Why are you appending second query with Count(*) query? Any specific need?
nagendrathecoder 8-Sep-11 8:51am View
nagendrathecoder 8-Sep-11 8:24am View
Have you tried my solution before downvoting it?
If yes then update your question and also tell us what error you are getting.
nagendrathecoder 8-Sep-11 8:05am View
Also check your query. Its wrong.
nagendrathecoder 8-Sep-11 8:02am View
Have you tried giving single argument to Count() or just Count(*)?
nagendrathecoder 8-Sep-11 8:00am View
nagendrathecoder 8-Sep-11 3:28am View
Good answer, my 5
nagendrathecoder 8-Sep-11 3:15am View
Thats right.
nagendrathecoder 8-Sep-11 3:15am View
Thanks Kami. But uday's point is also valid.
You must tackle SQL injections. :)
nagendrathecoder 8-Sep-11 2:44am View
Do not repost your question.
nagendrathecoder 7-Sep-11 6:36am View
You have to use "yyyy-MM-dd HH:mm" format.
HH gives 24 hour pattern whereas hh gives 12 hour pattern.
Try it.
nagendrathecoder 7-Sep-11 5:59am View
Thanks Ravi
nagendrathecoder 7-Sep-11 5:57am View
Best answer among all given, my 5. :)
nagendrathecoder 7-Sep-11 3:16am View
Are you getting any error?
What is happening?
nagendrathecoder 7-Sep-11 2:18am View
Search google.
nagendrathecoder 7-Sep-11 2:16am View
Your question is not too clear. Please explain what you want to do?
nagendrathecoder 7-Sep-11 2:15am View
What is the problem? Have you tried anything? where u got struck?
nagendrathecoder 6-Sep-11 6:22am View
Please check whether information is updating in database.
Monitor your query and updation logic.
nagendrathecoder 6-Sep-11 3:21am View
What you want is not clear to us.
Please explain your question and give details.
nagendrathecoder 5-Sep-11 2:49am View
I guess this is his general practise. If u look his previous questions, only he has answered those that too 4-5 times :D
nagendrathecoder 26-Aug-11 8:04am View
Many will help you, but first you need to put something on the board.
First try yourself and let us know what have you tried.
nagendrathecoder 26-Aug-11 8:02am View
Are you planning a Virus Attack?
nagendrathecoder 23-Aug-11 5:05am View
Good link
nagendrathecoder 19-Aug-11 8:09am View
Can you please post your query, it is very difficult to guess whats wrong without seeing query.
nagendrathecoder 19-Aug-11 7:44am View
Good answer, my 5
nagendrathecoder 17-Aug-11 9:00am View
Thanks for the link.
I can use GroupType for my purpose.
nagendrathecoder 17-Aug-11 8:59am View
Thanks john, that was helpful. Class name for both SecurityGroup and DistributionGroup is "Group". :)
Now i need to evaluate GroupType for the group objects.
nagendrathecoder 17-Aug-11 8:26am View
Debug your code and tell us exactly on which line it is throwing exception.
nagendrathecoder 17-Aug-11 8:00am View
Add that line after cmd.CommandText = "Select_Students"
nagendrathecoder 17-Aug-11 4:34am View
Just add this line
cmd.Parameters.Add("@sno", value_of_sno);
nagendrathecoder 17-Aug-11 3:39am View
You need to pass parameter to the SqlCommand object.
I guess your stored procedure is executing the query without where condition.
And in the code you are fetching row[0], so its always showing top row from datatable.
Pass parameter to stored procedure again after you are clearing parameters.
nagendrathecoder 17-Aug-11 3:32am View
You can comment on my answer, you don't need to add new answer for that.
nagendrathecoder 17-Aug-11 3:30am View
it will display the records of the "sno" you have passed to stored procedure.
So i guess you are getting correct result.
Do you want anything else too?
nagendrathecoder 17-Aug-11 3:20am View
Answer should be formatted so that it would be easy for OP to understand the code.
Anyways, lets stop it here only.
nagendrathecoder 17-Aug-11 3:20am View
Answer should be formatted so that it would be easy for OP to understand the code.
Anyways, lets stop it here only.
nagendrathecoder 17-Aug-11 3:15am View
i guess you wanted to tell this to OP right.
nagendrathecoder 17-Aug-11 3:14am View
She is clearing parameters and later not passing any parameter.
nagendrathecoder 17-Aug-11 3:13am View
You have replied to me. :D
nagendrathecoder 17-Aug-11 3:08am View
Have to tried to execute procedure in database?
Try to execute it and check whether its showing data or not.
nagendrathecoder 17-Aug-11 3:00am View
Please give more details of your question, its confusing.
What is text box file??
nagendrathecoder 17-Aug-11 2:51am View
Format your code properly.
if you would have searched google first then you might not needed to post question here coz you gave solution urself (isn't that amazing :D )
nagendrathecoder 17-Aug-11 2:47am View
Format your code snippet properly.
nagendrathecoder 16-Aug-11 8:21am View
You can edit your question, no need to post an answer for updating your question.
nagendrathecoder 16-Aug-11 8:18am View
Search Google
nagendrathecoder 12-Aug-11 3:06am View
Tell something more abt ur question
nagendrathecoder 11-Aug-11 9:00am View
If OP really wants this.....i can't imagine why he needs something like this.
Anyhow it is good answer
nagendrathecoder 11-Aug-11 8:55am View
Do you want to change the NAME of labels or TEXT of the labels?
nagendrathecoder 11-Aug-11 8:38am View
Your question is not too clear.
Do you want to write an application for searching files on computer?
nagendrathecoder 11-Aug-11 8:37am View
no need to post an answer, u can comment to his answer
nagendrathecoder 11-Aug-11 8:36am View
Not what he intended