![]() |
|
[C#] Help with Visual Studio Shortcuts - Printable Version +- Hack Forums (https://hackforums.net) +-- Forum: Tech (https://hackforums.net/forumdisplay.php?fid=444) +--- Forum: Coding (https://hackforums.net/forumdisplay.php?fid=151) +---- Forum: Software Development (https://hackforums.net/forumdisplay.php?fid=118) +---- Thread: [C#] Help with Visual Studio Shortcuts (/showthread.php?tid=4457455) |
Help with Visual Studio Shortcuts - eXaByte - Sep 22, 2014 I am using visual studio 2012 and im writing sql code in it. Is it possible to make a shortcut when i mark a text it will try to append that text to a SELECT * FROM statement so when i mark a table name and press ctrl + 1 it will select everything from that table * - Dialog - Sep 22, 2014 I don't fully understand your question, but you can add snippets of code/text to the toolbox if that's what you mean..? * - eXaByte - Sep 22, 2014 its a snippet of code 'SELECT * FROM ' and when i mark lets say a table name 'mytable' and i run this snippet of code with my defined combination it will select everything from that table sorta like concatenating the snippet with the marked text and executing it * - ShadowCloud - Sep 22, 2014 I wouldn't use "SELECT " to begin with. Please please please always name the columns you want from the query and only query the columns you are actually going to use. I can't tell you how many times I've seen on JOIN queries to return 100+ columns only for the developer to use like 5... * - eXaByte - Sep 22, 2014 I am using * because i will use this shortcut on objects which i would not know their column names also i just want to know the method of how to do this my example code is irrelevant * - ShadowCloud - Sep 22, 2014 (Sep 22, 2014 06:08 AM)eXaByte Wrote: I am using * because i will use this shortcut on objects which i would not know their column names Ah snap. I didn't consider that. Are you using MSSQL or MySql? * - eXaByte - Sep 22, 2014 (Sep 22, 2014 06:09 AM)ShadowCloud Wrote: Ah snap.im using visual studio to write tsql code because my project files need to be synced with others * - ShadowCloud - Sep 22, 2014 (Sep 22, 2014 06:10 AM)eXaByte Wrote: im using visual studio because my project files need to be synced with others No I meant is the datasource MSSQL or Mysql? I might need some more background information on this... but what I was going to is that you could select the columns from the sys tables... Ctrl+K, Ctrl +B as per the above user should work well for you I imagine? * - eXaByte - Sep 22, 2014 (Sep 22, 2014 06:13 AM)ShadowCloud Wrote: No I meant is the datasource MSSQL or Mysql? my problem is not how to select the column names i just want to know the way how to be able to execute a statement when i have a piece of text which will represent the name of an object so that execute statement concatenates with the name without me having to write for example exec sp_helptext name_ of_my_proc but only select the name of my proc and pressing lets say ctrl+3 and it will automanticly execute 'exec sp_helptext name_ of_my_proc' * - ShadowCloud - Sep 22, 2014 (Sep 22, 2014 06:20 AM)eXaByte Wrote: my problem is not how to select the column names i just want to know the way how to be able to execute a statement when i have a piece of text which will represent the name of an object so that execute statement concatenates with the name without me having to write for example exec sp_helptext name_ of_my_proc If you use a global keyboard hook (in the same fashion as a keylogger I imagine) you'd be able to make pretty much any combination do pretty much anything? The snippet will work work adding the text in front of the name, don't think it will concat though. * - eXaByte - Sep 22, 2014 (Sep 22, 2014 06:26 AM)ShadowCloud Wrote: If you use a global keyboard hook (in the same fashion as a keylogger I imagine) you'd be able to make pretty much any combination do pretty much anything?it might not be possible with the built in functions of visual studio i thought it would be easy because this feature is built in the MSSMS and is quite easy and comfortable using it * - ShadowCloud - Sep 22, 2014 (Sep 22, 2014 06:32 AM)eXaByte Wrote: it might not be possible with the built in functions of visual studio i thought it would be easy because this feature is built in the MSSMS and is quite easy and comfortable using it O you are talking about the query shortcuts... Have a look at this: http://stackoverflow.com/questions/3364618/in-visual-studio-change-the-keyboard-to-use-an-f-key-for-execute-sql Is that what you were after? * - eXaByte - Sep 22, 2014 (Sep 22, 2014 06:38 AM)ShadowCloud Wrote: O you are talking about the query shortcuts...No. But i expect that my answer will be somewhere in the same menu What i want to do is this just in visual studio. the example you showed will execute whatever i selected in my example i will execute whatever i selected with a prefix command |