Kendi bilgisayarımdaımda çalışırken böyle bir hata aldım.Hep aynı sorunla karşılaşıyorum.
Bu dosyada ve buna benzeyen birkaç dosyada hep aynı yerde, aynı hatayı alıyorum.Bu konuda bilgi sahibi arkadaslar yardımcı olursa sevinirim....not:sadp.Fill(verial);+++ problemli bölümler....Acil yardım.....
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Data.SqlClient;
public partial class veritabani2 : System.Web.UI.Page
{
string yol = @" Data Source=SERDAR\SQLEXPRESS;initial Catalog=Ogrenci;integrated Security=true";
SqlConnection baglanti;
SqlDataAdapter sadp;
DataSet verial;
protected void btnEkle_Click(object sender, EventArgs e)
{
string ad, soyad, adres, yas;
ad = this.txtAd.Text;
soyad = this.txtSoyad.Text;
adres = this.txtAdres.Text;
yas = this.txtYas.Text;
baglanti = new SqlConnection(yol);
string ekle = "insert into tblBilgiler"
+ "(ad,soyad,adres,yas) values "
+ "('" + ad + "','" + soyad + "','" + adres + "'," + yas + ")";
sadp = new SqlDataAdapter(ekle, baglanti);
verial = new DataSet();
sadp.Fill(verial);+++
Response.Write("Kayit Eklendi");
}
protected void btnSil_Click(object sender, EventArgs e)
{
string ad;
ad = this.txtAd.Text;
baglanti = new SqlConnection(yol);
string sil = "delete from tblBilgiler where Ad='" + ad + "'";
sadp = new SqlDataAdapter(sil, baglanti);
verial = new DataSet();
sadp.Fill(verial);+++
Response.Write("Adı " + ad + " kayit silindi");
}
protected void btnGuncelle_Click(object sender, EventArgs e)
{
string ad;
ad = this.txtAd.Text;
baglanti = new SqlConnection(yol);
string guncelle = "update tblBilgiler set yas=30 where ad='" + ad + "'";
sadp = new SqlDataAdapter(guncelle, baglanti);
verial = new DataSet();
sadp.Fill(verial);+++
Response.Write("Yas Güncellendi");
}
protected void btnDataGetir_Click(object sender, EventArgs e)
{
baglanti = new SqlConnection(yol);
string guncelle = "select * from tblBilgiler";
sadp = new SqlDataAdapter(guncelle, baglanti);
verial = new DataSet();
sadp.Fill(verial);+++
this.GridView1.DataSource = verial.Tables[0];+++
this.GridView1.DataBind();
}
protected void GridView1_SelectedIndexChanged(object sender, EventArgs e)
{
int deger = this.GridView1.SelectedIndex;
this.TextBox5.Text = this.GridView1.Rows[deger].Cells[2].Text;
}
}