|
Then use a List or something. We tend not to use arrays in C#.
|
|
|
|
|
Actually, you do know what's wrong: you're using an unassigned local variable. It will even tell you that strPLatitude is the culprit.
How to fix? Assign something to it, obviously. Most C# compile errors are easy like that.
You wanted a null array? Then make a null array: double[] strPLatitude = null;
That doesn't make the code work, I grant you, but it fixes this problem.
However, this:
tashee wrote: declared a null array but when i try to use this array to store my values Reveals a deeper problem. You can't use something that doesn't exist. Like Richard wrote, "You must allocate some space to it before you can store anything in it". Your reply to him seems to imply you didn't really get it.
This is like saying "I have a place where a bookshelf should go but there isn't one there yet, why do things go wrong when I try to store books in it?"
Don't use something that doesn't exist. You need an actual bookshelf, not just a place where a bookshelf could go.
PIEBALDconsult suggest you use a List, you should probably do that. Be sure to Add[^] the items to the list, don't try to stuff them into positions that do not exist.
|
|
|
|
|
Hello,
Im doing a big final project that manages a dive shop.
This application will have data base.
What im looking for is some example of solution that works with data base(connect to DB , SQL , Query) that i can take and modify it for my needs.
Thanks.
|
|
|
|
|
I can offer you some insight into creating a Data Access Layer.
DatabaseAccessor[^]
There are many similar articles on here.
|
|
|
|
|
I understand that article is from 2007, but I'd completely disregard it. It was completely bad practice even "back then". Definitely is horrible practice today. Use a proper data access layer like EF, nHibernate, etc. At the very least, if you use barebones ADO.NET, you should not write queries in the C# code like that. Completely vulnerable to a script kiddie who knows SQL injection.
|
|
|
|
|
SledgeHammer01 wrote: Completely vulnerable to a script kiddie who knows SQL injection
Bullshit -- it fully and easily supports parameters so there's no reason a developer has to leave himself open to that.
SledgeHammer01 wrote: EF, nHibernate, etc
And what do you think they do in the background? Exactly the same things I do. Everything has to go through a command and connection eventually; I cut out the middle man. Additionally, those tools may not support whatever database the OP has to use, whereas there is probably an ADO.net connector for it.
|
|
|
|
|
SledgeHammer01 wrote: It was completely bad practice even "back then".
Nonsense.
SledgeHammer01 wrote: you should not write queries in the C# code like that. Completely vulnerable to a script kiddie who knows SQL injection.
You and I must have completely different definitions of SQL injection then.
I don't see anything in there that suggests anything at all like that.
|
|
|
|
|
Most of the ORM providers are bult upon ADO.NET.
but personally I dont think there is anything wrong with using ADO.NET, SQL Injection is only possible when there is a lack of parameterised queries.
Lobster Thermidor aux crevettes with a Mornay sauce, served in a Provençale manner with shallots and aubergines, garnished with truffle pate, brandy and a fried egg on top and Spam - Monty Python Spam Sketch
|
|
|
|
|
Just do a search in the articles section on this site.
There are a number of good samples and articles here.
|
|
|
|
|
Actually i have one local area map i want to mark my location in one particular area in that local map.....How can i mark my location????
Pls give article or coding related this concept.
For Example i have America map means i want to specific my location in new work...how we can do this????
|
|
|
|
|
Not google maps so which mapping system?
What are you using to query the map? C#, JavaScript etc?
Are you stuck? If so where and what have you tried?
Lobster Thermidor aux crevettes with a Mornay sauce, served in a Provençale manner with shallots and aubergines, garnished with truffle pate, brandy and a fried egg on top and Spam - Monty Python Spam Sketch
|
|
|
|
|
i had america map(dynamic map) in my web page. In this map ,while i'm moving mouse to some states position , want to shows like that state information in chat box or some message box i.e. state name, weather-condition,etc...
I'm doing this project in c#.net....so pls guide me....
|
|
|
|
|
chat application in asp.net c# workflow
|
|
|
|
|
with that little help on what your problem is or what help you need to start this project I would recommend that you have a read here
Just another chat application using SignalR[^]
Lobster Thermidor aux crevettes with a Mornay sauce, served in a Provençale manner with shallots and aubergines, garnished with truffle pate, brandy and a fried egg on top and Spam - Monty Python Spam Sketch
|
|
|
|
|
I am developing an c# application and it uses many .net assemblies. For some reason i need to move a dll to program files folder and that dll depends on many other assembly present in the application folder and this makes me to copy all dependent dlls to programfiles folder. This will cause duplication of dll in both application and programfiles directory. I know that moving dependent assembly to GAC will resolve this issue but i shound not put many assembly in GAC. So please suggest a way to make .Net dll to reference its dependent dlls.
modified 23-Dec-12 0:22am.
|
|
|
|
|
whoever reading this actually i am into a project where we have to make an application that should generate a website as per the requirements of the user. its kind of web-portal. so if any body coould help.
|
|
|
|
|
What is your actual question? Do you have code that you are having a problem with or are you just fishing for someone to give you code?
|
|
|
|
|
I actually want to build a CMS for simple dynamic web pages as per user requirement. but i dont know from where to start but i have to do this with .net and i am a beginner in .net and i have been assigned this project. so if some one can give me any idea about what i have to do then it will be really helpful,i don't need the code but i need a direction that from where should i begin.
|
|
|
|
|
hi all,
i am working on a basic challenege for my course in C#, i have got to the point where i need the loop to do its actions until 2 statements become true but my program runs through the loop once and one statement becomes true and other false and then it jumps out of loop so i need to know what i have done wrong with the code or any advice please?
int z = 2;
if (remaindernum != 0 & remainderden != 0)
{
while (z <= totala)
{
while (remaindernum != 0 & remainderden != 0)
{
remaindernum = (newfraction % z);
remainderden = (totala % z);
z += 1;
}
}
}
just to clarify pretending my first line of code is 0,
it runs through fine till line 15 then goes back into loop at line 7 but then jumps down to line 16 and sticks in neverending loop
|
|
|
|
|
I suspect you want OR rather than AND. You may also want to use the Logical operators rather than the Bitwise ones.
|
|
|
|
|
basically its a loop to simplify a fraction , so i need that loop to keep running until both statements are true?
|
|
|
|
|
also should i be using a do statement for this kind of thing?
|
|
|
|
|
|
You are using the wrong operator, it should be the double ampersand thus:
if (remaindernum != 0 && remainderden != 0)
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
Hello,
I have a table consisting of following columns and data
Msg_count Latitude Longitude Utc_Time
16 56.6650356667 12.8772211667 142640
24 56.6650415 12.8772395 142640.25
35 56.6650475 12.8772581667 142640.5
26 56.665053 12.8772778333 142640.75
23 56.6650593333 12.8772976667 142641
26 56.6650656667 12.8773183333 142641.25
25 56.665072 12.8773388333 142641.5
15 56.6650785 12.8773598333 142641.75
i need to find out sum of messages transmitted every second.
For eg. when i group (142640, 142640.25, 142640.5, 142640.75) it makes 1 sec and total number of messages sent during this interval are
16+24+35+26=101
I don't know how can do this.
I am using PostgreSQL and C#.net
Does anyone have suggestion
Regards..
Tasha
|
|
|
|