1
Answer

Searching in Solution Explorer


Hi All,
  I have a requirement that primarily focusses on Searching Interfaces, Classes, Methods and properties on the Right Click of Solution Explorer.
ex: Sample Solution currently working/running in the VSIDE
MySolution
  |_ Project1
        |_ MyInterface.cs
        |_MyClass1.cs
        |_MyClass2.cs
        |_ properties
             |_ AssemblyInfo.cs
  |_ Project2
       |_Project2interface.cs
       |_Project2Class1.cs
       |_ Project2Class2.cs
       |_ Project2Class3.cs
I need to get all this information at this point of time
MySolution
------------------------------------------------------
|      Solution Explorer-----> Right Click         |
|                    BUILD                                    |  
|                    REBUILD                                |
|                    CLEAN                                   |
|                    ADD ....                                 |
|                                                                |
|          Get Project Details                       |
---------------------------------------------
When I Click (Get Project Details). I need to get all the interface/Classes/ methods/properties in Windows Form from currently running solution.
-----------------------------------------------------------------------------
|              Sample information on Windows Forms                     |
|        MyProject1(projectName).MyInterface(interfaceName)     |
|        MyProject1(projectname).MyClass1(className)              |
|             int Add(int a, int b)                                                  |
|             int Sub(int a, int b)                                                  |
|        MyProject1(projectname).MyClass2(className)             |
|              int mult(int a, int b)                                                |
|              int Divide(int a, int b)                                             |
|                                                                                          |
|       MyProject2(projectname).Project2interface(interfaceName) |
|              string concat(string a, string b)                                 |        
|         Myproject2(projectname).Project2Class1(className)      |
|              string append(string a, string b)                                |       
|         Myproject2(projectname).Project2Class2(className)       |
|              string copy(string a, string b)                                     |       
|         Myproject2(projectname).Project2Class3(className)       |
|              string truncate(string a, string b)                               |       
|                                                                                           |
----------------------------------------------------------------------------
Important Note: Should not read from the assembly(dll file) (can't use reflection)
Please let me know what should be my approach, appreciate your help.
Thanks,
MS
 
Answers (1)
0
naura pax
NA 1.9k 64.8k 15y

hi Pankaj,
if you are creating dynamic query then at the time of creating sql string you can do following example :
 wherestring+=txt.Replace("'","''"); 
// single quote is passed string in
//first parameter and single quote is written twice '' for second.
Accepted
0
Master  Billa
NA 2.7k 0 15y
Hi

when you are use the single quite you need add extra two quote to string.or else is make to sql injection.

About this please take look,

http://archives.devshed.com/forums/windows-107/sql-injecttion-401471.html

thank you


0
Pankaj Singh
NA 69 0 15y
Thanks
0
Pankaj Singh
NA 69 0 15y
Thanks
0
Kirtan Patel
NA 35k 2.8m 15y
Hi you just need to Replace every Single timeWriten Quote to Double Time

suppose you are inserting

string " pankaj's Name "


then you should write String Like

"Pankaj' 's name "     { Dobule time Single Quotes before 's' )

Thats it :)

Better to Write Function That Will Replace Every Single Time Quote to Write it Double time in String


public string CSQ(string str)
{
 
    return Strings.Replace(str, "'", "''");
}



if i Helps you please check "Do you like this answer"






0
jinge
NA 2.4k 23.5k 15y