473,396 Members | 1,678 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,396 software developers and data experts.

adding data

Hello,
I add my data from sqlserver to dropdownlist on formload.I wanted it doesnt
load data every time on form load.I made if session is null then load if
session isnt null dont load.I add to sqlserver a new data ans I make session
is null.But in dropdownlist I coudnt see my new data.I use below code for
adding.I make logic error. Is Using Session logic true? or I have to refresh
sql data if so how can I do this...
SqlConnection conn=new SqlConnection ();

conn.ConnectionString
="server=(local)\\sql2000;database=db_Kalite_Data; uid=sa;pwd=antalya";

SqlCommand cmd=new SqlCommand ();

cmd.Connection =conn;

string str="insert ........................";

cmd.CommandText =str;

conn.Open ();

cmd.ExecuteNonQuery ();

conn.Close ();

Thanks...

Nov 15 '05 #1
1 1379
Hi selen,

If you insert new data on the DB you will have to refresh the one kept in
session, following your logic you can set the session variable holding the
data to null, in this form the next time the data is needed it will be
loaded as it would be the first time that you run the application.
Hope this help,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation
"Selen" <sk*****@yahoo.com> wrote in message
news:%2***************@tk2msftngp13.phx.gbl...
Hello,
I add my data from sqlserver to dropdownlist on formload.I wanted it doesnt load data every time on form load.I made if session is null then load if
session isnt null dont load.I add to sqlserver a new data ans I make session is null.But in dropdownlist I coudnt see my new data.I use below code for
adding.I make logic error. Is Using Session logic true? or I have to refresh sql data if so how can I do this...
SqlConnection conn=new SqlConnection ();

conn.ConnectionString
="server=(local)\\sql2000;database=db_Kalite_Data; uid=sa;pwd=antalya";

SqlCommand cmd=new SqlCommand ();

cmd.Connection =conn;

string str="insert ........................";

cmd.CommandText =str;

conn.Open ();

cmd.ExecuteNonQuery ();

conn.Close ();

Thanks...

Nov 15 '05 #2

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

Similar topics

1
by: Geoff Biggs | last post by:
Evening all, I'm trying to add a new built-in number data type to Python with its own syntax, so I'm working directly with the interpreter rather than creating my own extension module (side...
5
by: Paul | last post by:
Hi I have a table that currently has 466 columns and about 700,000 records. Adding a new DEFAULT column to this table takes a long time. It it a lot faster to recreate the table with the new...
2
by: Chris Cobb | last post by:
I have a table that currently contains 718000 rows. I wish to add a column to the table. Adding this column anywhere other than the end of the table requires exporting data, a drop and recreate,...
5
by: Tim | last post by:
I have block of code adding values to dropdown list under if (!Page.IsPostBack) { adding items } else { refreshing data }
3
by: Jim Heavey | last post by:
Trying to figure out the technique which should be used to add rows to a datagrid. I am thinking that I would want an "Add" button on the footer, but I am not quite sure how to do that. Is that...
3
by: Robin Thomas | last post by:
I am fairly new to ASP.NET so I think I am missing something fundamental. Anyway, quite often I am pulling data from a database, but then I need to use that data to produce more data. A simple...
1
by: Andrew | last post by:
Hey all, I am very new to ASP.Net (and .Net in general), but that isn't stopping the boss from wanting to begin new projects in it. This latest project has me kinda stumped and after a couple...
10
by: Trevor | last post by:
Hey, I am trying to do this tutorial on the microsoft site : http://msdn.microsoft.com/library/default.asp? url=/library/en-us/dndotnet/html/usingadonet.asp I can get everything to work up to...
1
by: Tor Inge Rislaa | last post by:
Adding HTML tags to data from SQL server When dragging a table on to a web form in an ASP.NET 2.0 application, the connection is established and the data is displayed in a DataGrid. Is it...
0
by: AboutJAV | last post by:
I created a crystal report with the report.rpt reportdata.xsd I created the a new dataset with the reportdata myreportdata = new reportdata(); That automatically created a new dataset...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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
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,...

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.