tAhIra sgd

tAhIra sgd

  • NA
  • 22
  • 15.6k

insert method using database

Mar 28 2011 3:27 AM

i want to use insert query by using SQL server 2005.  I MAKE TABLE in sql server nad give them name of column but this is not giving proper output..

plz check what is the problem





using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.SqlClient;
namespace insert_method
{
class Program
{
static void Main(string[] args)
{
string constring ="Server=LAB02-19\SQLEXPRESS;Database=insert";
SqlConnection conn = new SqlConnection();
SqlCommand cmd;
conn.Open();
string Sql="Insert into info values" (stname , rollnum);
insert table_1(ali','1');
int a= cmd.ExecuteNonQuery();

}
}
}

Answers (4)