Friday, February 14, 2014

Consume .asmx Service References Using Windows Strore Apps

Please note that this is not database related post. I'm recently working on windows store app development. In one scenario I have been pushed to consume .asmx web services. At that time there were no other resources to follow for me. I found this methods using some unorthodox way. In last few days several of individuals ask about consuming web services in Store apps specially .asmx.

Here we go,

1. Add service reference to the project. (Service1)

2. Create   Service1SoapClient object for consume service







3.  Assume that your imported Service1 contains method that returns string and method is GetServiceData(). Therefore you need to create object called GetServiceDataResponse nameOfResult  

nameOfResult variable gets response asynchronously  from web service






 4.  Then you can get the response body (actual response we need) fro called nameOfResul like this.

 



5. Then you can use this string as you wish. This string is the actual string that return by GetServiceData()

Enjoy..... :)

Friday, July 26, 2013

Data Replication with SQL Server 2012

Replication is the process of copying and maintaining database objects in multiple databases that make up a distributed database system. Changes applied at one site are captured and stored locally before being forwarded and applied at each of the remote locations. Replication provides user with fast, local access to shared data, and protects availability of applications because alternate data access options exist. Even if one site becomes unavailable, users can continue to query or even update the remaining locations.

In SQL Server 2012 Management Studio you can create replication very simply. Replication makes your database more secure and effective

Here the steps ,
1.  Log on to the database server and R-click on the Replication folder and select new publication
 
2. In new publication click next.
3. Select distributor  that can be responsible for storing replication info. I don't have any other servers I select default server in my desktop


4. In SQL Server Agent  select whether SQL Server agent should start automatically or not  then click next

5. Then it will displays snapshot folder.

6. Then select database that you want to replicate. After that it prompt select Publication type to replicate your database.  For each publication type preview window in bottom will show discription about each of them. Select it as you want and click next.

7. Then in Articles we can choose objects to publish in replication. then click next

8. Add data filters if you need. then click next in the prompt
9. Schedule snapshot agent as you want. It will give you time bounded option as well.
10. In Agent security add snapshot agent. I choose SQL Server agent account and finally click finish. and add publication name in prompt.




Its done..


Tuesday, July 16, 2013

Consume Service References Using Windows Strore Apps

Please note that this is not database related post. I'm recently working on windows store app development. In one scenario I have been pushed to consume .asmx web services. At that time there were no other resources to follow for me. I found this methods using some unorthodox way. In last few days several of individuals ask about consuming web services in Store apps specially .asmx.

Here we go,

1. Add service reference to the project. (Service1)

2. Create   Service1SoapClient object for consume service








3.  Assume that your imported Service1 contains method that returns string and method is GetServiceData(). Therefore you need to create object called GetServiceDataResponse nameOfResult  

nameOfResult variable gets response asynchronously  from web service





 4.  Then you can get the response body (actual response we need) fro called nameOfResul like this.

 



5. Then you can use this string as you wish. This string is the actual string that return by GetServiceData()

Enjoy..... :)

Tuesday, April 30, 2013

READTEXT in T-SQL (SS2012)

This statement use to read text, ntext, or image values from a text, ntext, or image column, starting from a specified offset and reading the specified number of bytes.
Parameters of statement


  • table.column
Is the name of a table and column from which to read. Table and column names must
comply with the rules for identifiers. Specifying the table and column names is required;
however, specifying the database name and owner names is optional.

  • text_ptr
Is a valid text pointer. text_ptr must be binary(16).

  • Offset
Is the number of bytes (when the text or image data types are used) or characters
(when the ntext data type is used) to skip before it starts to read the text, image, or
ntext data.

  • Size
Is the number of bytes (when the text or image data types are used) or characters
(when the ntext data type is used) of data to read. If size is 0, 4 KB bytes of data is
read.

  • HOLDLOCK
Causes the text value to be locked for reads until the end of the transaction. Other
Users can read the value, but they cannot modify it.

Thursday, February 14, 2013

Document Oriented Database

        Designed for storing, retrieving, and managing document-oriented, or semi structured data, information. Document-oriented databases are one of the main categories of so-called NoSQL databases and the popularity of the term "document-oriented database" (or "document store") has grown with the use of the term NoSQL itself. In contrast to well-known relational databases and their notions of "Relations" (or "Tables"), these systems are designed around an abstract notion of a "Document".           
 At the highest level of organization, it is quite similar to a relational database, but as you get closer to the data itself, you will notice a significant change in the way the data is stored. Instead of databases, tables, columns, and rows you have documents. A document doesn’t have a direct correlation in the relational world. Documents do not have a predefined schema like relational database tables. A document is partly a row, in that it’s where the data is located, but it's also part columns, in that the schema is defined in each document (not table-wide).

          The best way to think of a document is as a multidimensional array. In an array, you have a set of keys that map to values. The values could themselves be another array. Documents map extremely well to objects and other PHP data types like arrays and even multidimensional arrays. Documents encapsulate and encode data (or information) in some standard formats or encoding. Encoding in use include XML, YAML, JSON, and BSON, as well as binary forms like PDF and Microsoft Office documents.
           Currently lot of web based online shopping websites are moving to this kind of databases. Simple and amaizing handling with database solutions like MongoDB, Apache CouchDB , Clusterpoint etc