-7

I don't understand what does this @ means in HotspotID = @HotspotID?

    public BestFit CheckBestFit(String hotspotID)
    {
        String sql = "SELECT ZoomOut FROM Components WHERE HotspotID = @HotspotID";
        Int32 value = 0;
    }
marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
S5498658
  • 127
  • 1
  • 6
  • 3
    https://www.google.com/search?q=what+does+at+sign+mean+in+sql – L.B Dec 05 '13 at 18:52
  • 1
    Parameters (for prepared statements): [msdn reference](http://msdn.microsoft.com/en-us/library/system.data.sqlclient.sqlcommand.parameters(v=vs.110).aspx) – newfurniturey Dec 05 '13 at 18:52
  • http://stackoverflow.com/questions/4096518/what-is-the-sign-in-front-of-parameters – Andrew Dec 05 '13 at 18:53

2 Answers2

1

It is the parameter in the query. However it seems as if you are not setting it

David Pilkington
  • 13,528
  • 3
  • 41
  • 73
0

It's a bound parameter marker. You'll need to list all bound parameters in the Parameters collection.

Using bound parameters as opposed to just constructing the SQL text directly helps with security (prevents injection attacks) and performance.

Branko Dimitrijevic
  • 50,809
  • 10
  • 93
  • 167