In this age it has not come across and when I discovered the solution I could not find any. I suppose it is surcharge in SQL, actually when I have "" (an empty string) for any parameter in this SQL, then I do not want to set a value in the database ...
Note: I want to do it at the SQL level, it is not at a C # level because its dirty way.
string Sql = "If you do not (SELECT * FROM tbl_FileSystemReferences)" + "tbl_FileSystemReferences (UploadDir) enter values (blank)" + "Reediyl = @ Flasdayr, +" Flasdayr = @ Flasdayr, + "Sosiattedfaildaiar =" "@AssociatedFilesDir," + EnableArchiving = EnableArchiving, "+" AppWideDir = @AppWideDir, "+" Ffmpiijiar = @ Ffmpijeediaiar, "+" InstallationDir = @ InstallationDir "; SqlCommand Command = new SqlCommand (Sql); Command parameter.Advate value ("@ UploadDir", f.UploadDir); Command parameter.Advate value ("@ Thumbnaille", F. Thambane L'Deer); command. Parameters. Advetvalu ( "@ Arkaivdir" F. Arcivdir); command. Parameters. Advet value ( "@ Riyldir" F. Rildir); command. Parameters. Advet value ( "@ Flasdir" F. . Flash DIR); command. parameters. Advet value ( "@ Sosiattedfaildayr" FkAssociatedFilesDir); command. parameters. Advet value ( "@ Aktivrviving" f. capable Krenarving); command. parameters. Advet value ( "@ app Weddier ", F. App World Directory); Brand. Parameters. Advant Value ("@ffmpgdir", FFFMAPGDRIR); Command. Parameter. Advance Value ("@ InstallationDir", F. Installation DIR); ExecuteNonQuery; I know that in a way I used to do it with the stored procedure, I just can not remember how (I think it has been said overloading ) ....
Cheers,
In a way, on a stored procedure Where you will get all those parameters, then before the query either:
- You give zero permission to pass
-
Change the rimmer to clear if they are empty:
@UploadDir = tap where @UploadDir = ''
You can specify all your parameters to do this, then update query:
If you do not have to insert the SELECT * tbl_FileSystemReferences (UploadDir) values Tbl_FileSystemReferences uPDATE tbl_FileSystemReferences SET UploadDir = coalesce (@UploadDir, UploadDir), Thnbneldair = millennium (@ThumbnailDir, ThumbnailDir), ArchiveDir = coalesce (@ArchiveDir, ArchiveDir), RealDir = Kolases (@ Real Dir, Riyldir), Flasdir = Kolasej (@ Flash Diaia , Flashdir), Associated FileDy = Colesay (@SSAssetAdfaladder, AssociatedFileServer), EnableArviving = Millennium (@EnableArchiving, EnableArchiving), AppWideDir = coalesce (@AppWideDir, AppWideDir), FFmpegDir = coalesce (@FFmpegDir, FFmpegDir), InstallationDir = coalesce (@ InstallationDir, InstallationDir)
Comments
Post a Comment