Click here to Skip to main content
15,884,099 members
Home / Discussions / C#
   

C#

 
QuestionRefreshing DataSet Pin
emran83429-Jan-06 13:57
emran83429-Jan-06 13:57 
AnswerRe: Refreshing DataSet Pin
imsathy29-Jan-06 20:12
imsathy29-Jan-06 20:12 
GeneralRe: Refreshing DataSet Pin
emran83430-Jan-06 5:58
emran83430-Jan-06 5:58 
AnswerRe: Refreshing DataSet Pin
Drew McGhie30-Jan-06 3:38
Drew McGhie30-Jan-06 3:38 
GeneralRe: Refreshing DataSet Pin
emran83430-Jan-06 6:14
emran83430-Jan-06 6:14 
GeneralRe: Refreshing DataSet Pin
Drew McGhie30-Jan-06 10:15
Drew McGhie30-Jan-06 10:15 
GeneralRe: Refreshing DataSet Pin
emran83430-Jan-06 11:52
emran83430-Jan-06 11:52 
GeneralRe: Refreshing DataSet Pin
imsathy30-Jan-06 18:27
imsathy30-Jan-06 18:27 
emran834 wrote:
But I dont know the right Snippet to refresh the Disconnected DataSet So that The DataSet should Open The Connection Again and load the the new data from the Physical Database Just After Clicking a button responsible for ADD or Delete.


Perfectly workin for me

this is how i did, i wrote a function for filling the grid separately and calling it on a button click event.
and i deleted a row on another button click event and called the same function again.

<br />
public void fillgriddd()<br />
{<br />
SqlDataAdapter sd = new SqlDataAdapter("select * from country",Con);<br />
DataSet ds = new DataSet();<br />
sd.Fill(ds);<br />
dg.DataSource=  ds.Tables[0].DefaultView;;<br />
}<br />
<br />
private void button1_Click(object sender, System.EventArgs e)<br />
{<br />
fillgriddd();<br />
}<br />
<br />
private void button2_Click(object sender, System.EventArgs e)<br />
{<br />
SqlDataAdapter sd = new SqlDataAdapter("delete from country where ctryname = 'austria'",Con);<br />
Con.Open();<br />
sd.SelectCommand.ExecuteNonQuery();<br />
Con.Close();<br />
fillgriddd();<br />
}<br />
<br />


Hope it would help

Sathy
GeneralRe: Successful but had to modify little. Pin
emran83431-Jan-06 17:04
emran83431-Jan-06 17:04 
Questionsql server license Pin
fmardani29-Jan-06 12:54
fmardani29-Jan-06 12:54 
AnswerRe: sql server license Pin
bootn29-Jan-06 17:21
bootn29-Jan-06 17:21 
AnswerRe: sql server license Pin
Dario Solera29-Jan-06 22:22
Dario Solera29-Jan-06 22:22 
QuestionAudio Problem Pin
snouto29-Jan-06 12:44
snouto29-Jan-06 12:44 
QuestionWindows Media Player Remote Control Pin
pittuck29-Jan-06 12:32
pittuck29-Jan-06 12:32 
QuestionMigration from .NET 1.1 to 2.0 Pin
MrEyes29-Jan-06 11:28
MrEyes29-Jan-06 11:28 
AnswerRe: Migration from .NET 1.1 to 2.0 Pin
User 665829-Jan-06 11:39
User 665829-Jan-06 11:39 
AnswerRe: Migration from .NET 1.1 to 2.0 Pin
leppie29-Jan-06 17:56
leppie29-Jan-06 17:56 
QuestionDatabase search Pin
BH Serpa29-Jan-06 10:36
BH Serpa29-Jan-06 10:36 
QuestionWPF in VSTS ? Pin
Christian Graus29-Jan-06 9:53
protectorChristian Graus29-Jan-06 9:53 
AnswerRe: WPF in VSTS ? Pin
User 665829-Jan-06 10:14
User 665829-Jan-06 10:14 
AnswerRe: WPF in VSTS ? Pin
Joshua Quick29-Jan-06 10:18
Joshua Quick29-Jan-06 10:18 
GeneralRe: WPF in VSTS ? Pin
Christian Graus29-Jan-06 10:31
protectorChristian Graus29-Jan-06 10:31 
GeneralRe: WPF in VSTS ? Pin
Joshua Quick29-Jan-06 11:09
Joshua Quick29-Jan-06 11:09 
GeneralRe: WPF in VSTS ? Pin
Christian Graus29-Jan-06 11:45
protectorChristian Graus29-Jan-06 11:45 
Questionassigning objects a name programmatically Pin
usernamed29-Jan-06 9:37
usernamed29-Jan-06 9:37 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.