473,408 Members | 1,747 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,408 software developers and data experts.

Please view this code to see what is wrong??


Hi,

I want to be able change data in dataGrid after SelectedIndex in
DropDownList is changed. DataGrid1 visible is set on false and after
SelectedIndexChanged in DropDownList visible should be set on
true(first line in BindData(string nazwaPrzedmiotu)). But even if it
is defoult true I can see dataGrid but nothing has changed there:/ I
don't know why:/ how to solve this problem please help... There is
the code:
protected void BindData(string nazwaPrzedmiotu)
{
DataGrid1.Visible = true;
string CS = "workstation id=(local);packet
size=4096;integrated security=SSPI;data source=(local);persist
security info=False;initial catalog=sosik";
SqlConnection conSOS = new SqlConnection(CS);
string qry = "WybierzPytanie";
SqlCommand cmdNazwa = new SqlCommand(qry, conSOS);
cmdNazwa.CommandType = CommandType.StoredProcedure;
conSOS.Open();
SqlCommandBuilder.DeriveParameters(cmdNazwa);
cmdNazwa.Parameters["@nazwaPrzedmiotu"].Value =
nazwaPrzedmiotu;
cmdNazwa.Parameters["@przedmiotyID"].Value = 1;
cmdNazwa.ExecuteNonQuery();
SqlDataAdapter daNazwa = new SqlDataAdapter(cmdNazwa);

DataTable tblClient = new DataTable();
daNazwa.Fill(tblClient);
DataGrid1.DataSource = tblClient;
DataGrid1.DataBind();
conSOS.Close();
}
protected void
DropDownListWybierzprzedmiot_SelectedIndexChanged( object sender,
EventArgs e)
{

BindData(DropDownListWybierzprzedmiot.SelectedItem .Text.ToString());
}

Apr 21 '07 #1
0 963

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Tony Marston | last post by:
For those who you thought my method of implementing OO principles in PHP was totally wrong - see http://www.tonymarston.co.uk/php-mysql/good-bad-oop.html for details, you can now read...
5
by: duikboot | last post by:
Hi all, I'm trying to export a view tables from a Oracle database to a Mysql database. I create insert statements (they look alright), but it all goes wrong when I try to execute them in Mysql,...
2
by: TeknoCat | last post by:
Hey everyone, I may be repeating myself here, but if someone sent a reply then I missed it, and I can't get Outlook Express to download any messages more than 2 days old. Anyway, I'm having a...
5
by: TrvlOrm | last post by:
HI There, I have been struggling with JavaScript code for days now, and this is my last resort! Please help... I am trying to create a JavaScript slide show with links for Next Slide,...
3
by: Paolo | last post by:
Hi, I am trying to compact and repair my database, however every time I try it comes up a message saying: Table: "TempMSysAccessObject already exists", whenever I try to look for this table I...
1
by: David Van D | last post by:
Hi there, A few weeks until I begin my journey towards a degree in Computer Science at Canterbury University in New Zealand, Anyway the course tutors are going to be teaching us JAVA wth bluej...
22
by: Amali | last post by:
I'm newdie in c programming. this is my first project in programming. I have to write a program for a airline reservation. this is what i have done yet. but when it runs it shows the number of...
15
by: Konstantin Andreev | last post by:
I'm almost sure I've found bad bug, but for a while I can't neither confirm nor reject this. If anybody could make an independent test on it's own system, I'd appreciate it very much. The...
1
by: joey.powell | last post by:
Hey guys, I am trying to get PHP working on a Windows Vista Ultimate box running IIS 7. First I made sure IIS was working properly....it is because it serves up aspx (asp.net) pages (please...
3
by: theintrepidfox | last post by:
Dear Group I'd be grateful if you can provide me with a hint for the following: Fields Table Contact ContactID Firstname Lastname Fields Table ContactMethod
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.