Profile
Achievement
![first submission:submitting first snipplet first submission:submitting first snipplet](/img/badge/badge_2.png?v3)
emregulcan's Recent Snippets
- All /
« Prev 1 Next »
This snippet is "extension method" for IDataReader.
You can use this snippet below ;
I assume you have datareader like that
SqlDataReader dataReader = command.ExecuteReader();
if (dataReader.IsColumnExists("columnName"))
{
//do something...
0
1178
posted 13 years ago by emregulcan
This trigger returns a resultset that includes last inserted record's guid info (uniqueidentifier)
If your column is uniqueidentifier and its default value is newid() , you can't get last record id (guid) with @@identity .
So, I write a trigger...
1
554
posted 13 years ago by emregulcan
You can see details on http://msdn.microsoft.com/en-us/library/ms178592.aspx , but I try to explain how you throw error with "uniqueidentifier" type parameters.
I convert uniqueidentifier to string (nvarchar(50)) and set a variable.
"%s" is equal...
0
1470
posted 13 years ago by emregulcan
Today I need Trim() function in sql, but in Sql 2005 there is no function. Because of that I wrote this user (scalar) fuction.
It's very basic;
-First; it's Right Trim (RTrim()) string
- And then Left Trim (LTrim())
0
540
posted 13 years ago by emregulcan
You can run this sql scripts in your database.
Firstly it creates a database and after insert records (timezones)
4
866
posted 14 years ago by emregulcan
This snippet just updates your tables which infected "<script> </script>" code blocks.
You must update all columns one by one.
2
836
posted 14 years ago by emregulcan
You can convert a string to hex or vice-versa with this methods.
Example for real world;
You want set / get some data from URL, but if your data has some special chars (like ^$ %) it'll be problem... In this case, you can use this methods and conve...
2
1885
posted 14 years ago by emregulcan
You can use this SP like that;
Exec CleanInjection 'INFECTED WORD','CLEAN WORD'
(in use : Exec CleanInjection '<script></script>','')
2
780
posted 14 years ago by emregulcan
This script works good condition, and not use "oAuth".
Your should get username and password with cleartext (standart html controls) without authentication and just add them into variables in your code...
(twitter_username and twitter_password)
A...
0
772
posted 14 years ago by emregulcan
You can get all countries list by this method.
Also you can find some details for countries like;
- original name,
- three letter ISO region name,
- three letter WINDOWS region name,
- currency symbol
etc..
1
901
posted 14 years ago by emregulcan
You can change your dynamic binding eval text with this method.
This method should be in same codebehind
0
748
posted 14 years ago by emregulcan