Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
C

chohanpk

@chohanpk
About
Posts
27
Topics
10
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Difference between form authentication and windows authentication
    C chohanpk

    whats the difference between form base authentication,windows authentication,and session management.and in whaich situation we should use form authentication,in which windows authentication and in which sessions. -- modified at 1:03 Friday 16th February, 2007

    Chohan

    ASP.NET security

  • sessions
    C chohanpk

    i want to learn how to create session in asp.net using c#.tel me some guideline or tutorial from where i can fully understand the process flow

    Chohan

    ASP.NET csharp tutorial asp-net

  • date
    C chohanpk

    how can i insert date into my database using calender control in asp.net,c#

    Chohan

    ASP.NET csharp asp-net database question

  • how can insert an image path using formview control
    C chohanpk

    i have a 'pic' field of varchar in my database table where i want to store image path . how can i insert a path of a image using 'file upload' control in 'formview' insertitemtemplate.

    Chohan

    ASP.NET database question

  • Datatables
    C chohanpk

    now for learning purpose

    Chohan

    ASP.NET help tutorial question

  • Datatables
    C chohanpk

    yeah.i want to add tables,insert columns ,rows and then display data of that tables.

    Chohan

    ASP.NET help tutorial question

  • Datatables
    C chohanpk

    i ve to do it with dataview.but i want to know how i can add it to db n then display through dataadapter.

    Chohan

    ASP.NET help tutorial question

  • Datatables
    C chohanpk

    tel me how can i do this? wht ll be the code?

    Chohan

    ASP.NET help tutorial question

  • Datatables
    C chohanpk

    here is code: DataTable dt = new DataTable("tblcheck"); DataColumn dc1 = new DataColumn("col1", typeof(int)); dt.Columns.Add(dc1); DataColumn dc2 = new DataColumn("col2", typeof(int)); dt.Columns.Add(dc2); DataSet ds = new DataSet(); ds.Tables.Add(dt); DataRow dr1 = dt.NewRow(); dr1["col1"] = 1; dr1["col2"] = 2; dt.Rows.Add(dr1); //SqlDataAdapter adp2 = new SqlDataAdapter("select col1 from dt", con); //adp2.Fill(ds, "dt"); GridView1.DataSource = ds; GridView1.DataBind(); if i dont nclude these rows, "SqlDataAdapter adp2 = new SqlDataAdapter("select col1 from dt", con); adp2.Fill(ds, "dt");" then it shows values. but with these dataadapter code it gives error.i want to use dataadpater to fill the dataset.what will be the solution?

    Chohan

    ASP.NET help tutorial question

  • Datatables
    C chohanpk

    yes alredy no table exist i nnorthwind with this name. but with this command i m creating new table n also create columns n rows and add data in it. DataTable dt = new DataTable("tblcheck"); DataColumn dc1=new DataColumn("col1",typeof(int)); dt.Columns.Add(dc1); DataColumn dc2=new DataColumn("col2",typeof(int)); dt.Columns.Add(dc2); DataRow dr1 = dt.NewRow(); dr1["col1"]=1; dr1["col2"]=2; dt.Rows.Add(dr1); SqlDataAdapter adp2 = new SqlDataAdapter("select * from tblcheck", con); adp2.Fill(ds, "tblcheck"); GridView1.DataSource = ds; GridView1.DataBind();

    Chohan

    ASP.NET help tutorial question

  • Datatables
    C chohanpk

    after doing this correction ,now when executing error comes "Invalid object name 'tblcheck'. " on adp2.Fill(ds, "tblcheck");

    Chohan

    ASP.NET help tutorial question

  • Datatables
    C chohanpk

    protected void Page_Load(object sender, EventArgs e) { SqlConnection con = new SqlConnection("connection string"); DataSet ds = new DataSet(); DataTable dt = new DataTable("tblcheck"); DataColumn dc1=new DataColumn("col1",typeof(int)); dt.Columns.Add(dc1); DataColumn dc2=new DataColumn("col2",typeof(int)); dt.Columns.Add(dc2); //DataRow dr1=new DataRow(); DataRow dr1 = dt.NewRow(); dr1("col1")=1; dr1("col2")=2; dt.Rows.Add(dr1); SqlDataAdapter adp2 = new SqlDataAdapter("select * from tblcheck", con); adp2.Fill(ds, "tblcheck"); GridView1.DataSource = ds; GridView1.DataBind(); } error is "dr1 is a variable but is used like a method." tel me how to handle it?

    Chohan

    ASP.NET help tutorial question

  • ADO.net
    C chohanpk

    i m using the "northwind" database. n there are matching countries there like USA . and what is "view source" kindly tel me.

    Chohan

    ASP.NET database csharp com help tutorial

  • ADO.net
    C chohanpk

    tel me wats wrong in my code, give me right code

    Chohan

    ASP.NET database csharp com help tutorial

  • ADO.net
    C chohanpk

    sorry i didnt understand what u asked? as i m begginer in asp.net.

    Chohan

    ASP.NET database csharp com help tutorial

  • ADO.net
    C chohanpk

    i give parameter befor but now it didnt show anything .just open a blank page. protected void Page_Load(object sender, EventArgs e) { SqlConnection con= new SqlConnection("Data Source=n-6e9a4f688df44;Initial Catalog=Northwind;Integrated Security=True"); con.Open(); SqlCommand com = new SqlCommand("ShowSuppliers", con); com.CommandType = CommandType.StoredProcedure; //SqlDataReader reader = com.ExecuteReader(); SqlParameter parm = com.Parameters.Add("@txt", SqlDbType.VarChar, 50); parm.Direction = ParameterDirection.Input; parm.Value = "UK"; SqlDataReader reader = com.ExecuteReader(); while (reader.Read() == true) { Response.Write(reader[0].ToString() + "
    "); } reader.Close(); con.Close(); } will you plz tel me what will be the right code? and how can i do it using execute "ExecuteNonQuery", also code for this. thanks

    Chohan

    ASP.NET database csharp com help tutorial

  • ADO.net
    C chohanpk

    but i m following the tutorial.when i m using the executenonquery,it gives the "int " error as u said.and when i m using ExecuteReader before sqlparamerters,as in tutorial,it gives error"Procedure 'ShowSuppliers' expects parameter '@txt', which was not supplied." protected void Page_Load(object sender, EventArgs e) { SqlConnection con= new SqlConnection("Data Source=n-6e9a4f688df44;Initial Catalog=Northwind;Integrated Security=True"); con.Open(); SqlCommand com = new SqlCommand("ShowSuppliers", con); com.CommandType = CommandType.StoredProcedure; SqlDataReader reader = com.ExecuteReader(); SqlParameter parm = com.Parameters.Add("@txt", SqlDbType.VarChar, 50); parm.Direction = ParameterDirection.Input; parm.Value = "UK"; while (reader.Read()== true) { Response.Write(reader[0].ToString() + "
    "); } reader.Close(); con.Close(); } .and when i used ExecuteReader after sqlparameter it shows nothing on output protected void Page_Load(object sender, EventArgs e) { SqlConnection con= new SqlConnection("Data Source=n-6e9a4f688df44;Initial Catalog=Northwind;Integrated Security=True"); con.Open(); SqlCommand com = new SqlCommand("ShowSuppliers", con); com.CommandType = CommandType.StoredProcedure; SqlDataReader reader = com.ExecuteReader(); SqlParameter parm = com.Parameters.Add("@txt", SqlDbType.VarChar, 50); parm.Direction = ParameterDirection.Input; parm.Value = "UK"; //SqlDataReader reader = com.ExecuteNonQuery(); //SqlDataReader reader = com.ExecuteReader(); while (reader.Read()== true) { Response.Write(reader[0].ToString() + "
    "); } reader.Close(); con.Close(); } n for procedure i want to create a procedure then y its changed to Alter.i dont want edit any value. kindly check the tutorial.

    Chohan

    ASP.NET database csharp com help tutorial

  • ADO.net
    C chohanpk

    i m using the tutorial "href="http://www.sitepoint.com/article/introduction-ado-net/3" to access values from database through ado.net using stored procedure.but its not working.here is my code protected void Page_Load(object sender, EventArgs e) { SqlConnection con= new SqlConnection("////here is my connection string/////"); con.Open(); SqlCommand com = new SqlCommand("ShowSuppliers", con); com.CommandType = CommandType.StoredProcedure; //SqlDataReader reader = com.ExecuteReader(); SqlParameter parm = com.Parameters.Add("@txt", SqlDbType.VarChar, 50); parm.Direction = ParameterDirection.Input; parm.Value = "US"; SqlDataReader reader = com.ExecuteNonQuery(); while (reader.Read()== true) { Response.Write(reader[0].ToString() + "
    "); } reader.Close(); con.Close(); } and one of problem is whenever i m saving my procedure as in tutorial, it always chages "create PROCEDURE" with "ALTER PROCEDURE"

    Chohan

    ASP.NET database csharp com help tutorial

  • paging in Datalist
    C chohanpk

    how can i do the paging in Datalist control.tel me some useful links .

    Chohan

    ASP.NET question

  • how to check the number validator in asp.net using custom validate
    C chohanpk

    ([0-9]*) use this regular expression in validationexpression property of the validator control

    Chohan

    ASP.NET csharp asp-net tutorial
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups