Saturday, 21 December 2013
Cute Download Manager
A free tool to download your files very quickly .It is not only free it is very useful .You can give your list of downloads here and download them sequentially one by one serially. Please select the location where you want to save the files. Multiple files in the same name will be overwritten.
Wednesday, 18 December 2013
Entity Framework In Some Simple Steps
Entity Framework:
Entity Framework is the Hot-Cake of Today. This enables programmer a Bug free
database operation using simple some commands. It is a Strong framework and
easy to implement.
Definition : Entity framework is an Object Relational Mapper
(ORM).It is basically generates business objects and entities according to
database tables and provides the process for CRUD (Create Operation, Read Operation , Update
Operation And Also Delete Operation. )
Above diagram explain the structure of Entity Framework in
the respect of .net Technology.
Then it is clear that Entity Framework resides on or above
the ADO.net. That means we are using the Entity Framework as usual but the
difference is that we are not handling the connection the command directly.
Process of adding an EDMX file: [Note: To use entity
framework you must install the .net Entity Framework.]
Click the Finish button to Finish the operation.
Here I have Entered “Contact.edmx “ .
I have the following Field in My Table Contact.
To Add
A single Contact:
TestEntities DB = new TestEntities();
Contact Con = new Contact();[This is the object of Contact
Model]
Con.lname = txtLname.Text.ToString();
Con.fname =
txtFname.Text.ToString();
Con.phone =
txtPhone.Text.ToString();
Con.Roll =
txtRoll.Text.ToString();
TestEntities OB
= new TestEntities();[TestEntities Object Will Handle The
DataBase Operation And Will Generated Automatrically in The EDMX file]
OB.Contacts.AddObject(Con);[Adding a New Object For New
Contact]
OB.SaveChanges();[This will affect the Real DataBase ]
Try your
Self to Delete, and Update Data
If you made any changes in the database then just :-
Click the Update
Model from DataBase
Changes will be made automatically.
Friday, 13 December 2013
Datatable To XML string in .net Using Gridview
I have Used a data Gridview to make my own edited xml string which I will use in SQL
server stored procedure as argument .
Now the code is here :
using
System;
using
System.Collections.Generic;
using
System.ComponentModel;
using
System.Data;
using
System.Drawing;
using
System.Linq;
using
System.Text;
using
System.Windows.Forms;
using
System.Data;
namespace
WindowsFormsApplication1
{
public partial class Form1 : Form
{
DataTable
DT = new DataTable();
public
Form1()
{
InitializeComponent();
}
private
void Form1_Load(object
sender, EventArgs e)
{
DT.Columns.Add("Name", typeof(string));
DT.Columns.Add("Phone", typeof(string));
DT.Columns.Add("Address", typeof(string));
dataGridView1.DataSource = DT;
}
private
void btnXml_Click(object
sender, EventArgs e)
{
DataSet
DS = new DataSet();
DS.Tables.Add(DT);
MessageBox.Show(DS.GetXml());
}
}
}
The result will be in XML
After this how you will use this XML string in SQL server that you can find in my article Using XML string in Stored Procedure(SP) in Sql Server
Thursday, 12 December 2013
Using XML string in Stored Procedure(SP) in Sql Server
--EASY UNDER STANDING FOR XML TO TABLE CONVERSION
DECLARE @XMLSTRING VARCHAR(1000)DECLARE @idoc INT
SET @XMLSTRING='<TABLE><TR><NAME>ARINDAM</NAME><PHONE>9432987305</PHONE><ADDRESS>BARASAT</ADDRESS></TR><TR><NAME>ARINDAM</NAME><PHONE>9432987305</PHONE><ADDRESS>BARASAT</ADDRESS></TR><TR><NAME>RAJA</NAME> <PHONE>9432987306</PHONE> <ADDRESS>KOLKATA</ADDRESS></TR><TR><NAME>BABU</NAME> <PHONE>9831920688</PHONE> <ADDRESS>MADHYAMGRAM</ADDRESS></TR></TABLE>'
--IN THE ABOVE SECTION THIS IS THE XML STRING THAT YOU WANT TO CONVERT INTO TABLEEXEC sp_xml_preparedocument @idoc OUTPUT,@XMLSTRING
SELECT * FROM OPENXML(@idoc,'/TABLE/TR',2)
WITH(NAME VARCHAR(50),PHONE VARCHAR(50),[ADDRESS] VARCHAR(150))
--NOW IF YOU WANT TO USE THIS TABLE INTO YOUR STORED PROCEDURE
--THEN DECLARE A TABLE VARIABLE IN THE FOLLOWING PROCESS
DECLARE @RESULT_TABLE TABLE(NAME VARCHAR(50),PHONE VARCHAR(50),[ADDRESS] VARCHAR(150))
INSERT INTO @RESULT_TABLE(NAME,PHONE,[ADDRESS])
SELECT * FROM OPENXML(@idoc,'/TABLE/TR',2)
WITH(NAME VARCHAR(50),PHONE VARCHAR(50),[ADDRESS] VARCHAR(150))
SELECT * FROM @RESULT_TABLE
Software Download Page
Find The Even Numbers In a Given Range In C Language
Simple C language Program To Find The Even Numbers In a Given Range
#include <stdio.h>/*Header File To Enable Standard Input Output functionality*/
#include <stdio.h>/*Header File To Enable Standard Input Output functionality*/
int n;/*For Given Number*/
n=10;
int i=2;
while(i<=n)
{
if((i%2)==0)
{
printf("%d",i);
}
i++;
}
n=10;
int i=2;
while(i<=n)
{
if((i%2)==0)
{
printf("%d",i);
}
i++;
}
Subscribe to:
Posts (Atom)