Sunday, February 17, 2008

Shortcut to add Namespace automatically while coding in class file - C#

While coding a class file, you might encounter situations where you come to know that namespace is missing and you need move to top of file and add a namespace by "using" keyword.

e.g. you are writing a DAL (Data Access Layer) and have to create a variable of "SqlDataReader". Suddenly you recognize that "System.Data.SqlClient" is missing (its a pain sometimes..). In this case you need to move top and type there.

Below is the shortcut for this problem. Taking above example, type SqlDataReader and press "Alt+Shift+F10" and press enter to create a namespace automatically.



Press "Alt+Shift+F10" to show Smart Tag and press enter to select first option.



You see, "System.Data.Sqlclient" got added without going and typing it...


Let me know your comments..

6 comments:

  1. gud shortcut lists you have..do you have some for vs 2008?

    ReplyDelete
  2. thank you very much

    ReplyDelete
  3. The Chiefs are scheduled to host the Houston Texans in the NFL opener, representing a Texans vs Chiefs Stream rematch of the divisional playoff game. Kansas City won 51 31 — but only after trailing 24 0. The Chiefs then scored a touchdown on their next seven possessions and kicked a field goal on the eighth. It was the first time in NFL postseason history that a team trailed by at least 20 points and wound up winning by at least 20.

    ReplyDelete

  4. The Cowboys will allocate not far afield off from the Falcons upon Sunday, September 20, 2020 at 12 p.m. in their first Cowboys vs Falcons Liveregular season estate game of the 2020 season. The entire NFL schedule was released re Thursday night and the trigger game NFL season in 2020.

    ReplyDelete
  5. The passage of time hasn’t erased the Texans vs Chiefs Live memory of how the Houston Texans’ season came to an end.

    A waitress in Texas shared a photo of a receipt that was left on her table on Sunday that showed a Houston fan didn’t leave any money because the Chiefs beat the Texans in the AFC Divisional Playoff game in January.

    A Twitter user named QueenLilDash was wearing a Chiefs mask at work and that apparently triggered the Houston fan.

    ReplyDelete