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

It wont work

13
hello all

I am using .Net C# & MySql i made a data entry form to fill the tables and it's working ok. my data entry form consists of textboxes through each one I will save the data to the tables. the problem began when I tried to display the info. in my tables using the textbox, I want to be able not just to enter data but also walk through my table using a next and prev. buttons . here is my code

Expand|Select|Wrap|Line Numbers
  1.  
  2. private void next_Click(object sender, System.EventArgs e)
  3.         {
  4.             i+=1;
  5.  
  6.             if (i <= ds.Tables[0].Rows.Count)
  7.             {
  8.  
  9.     empid.Text = ds.Tables[0].Rows[i][0].ToString();        empnam.Text = ds.Tables[0].Rows[i][1].ToString();
  10.     empdesc.Text = ds.Tables[0].Rows[i][2].ToString();
  11. i+=1;
  12. }
  13.  
  14.  
the table contains 10 records but the button only work for one click

thank you all for your concern
Jan 21 '07 #1
5 1255
kenobewan
4,871 Expert 4TB
Basically you need to refill the dataset from the data adapter each time that you use it...

Hope that this helps.
Jan 21 '07 #2
kenobewan
4,871 Expert 4TB
Actually first port of call is the variable i, the function will not increment the way it does in a loop as the value is not returned... Try declaring it as a global variable and returning it.

Hope that this helps.
Jan 21 '07 #3
seshu
156 100+
hi this is seshu actually i never tried your doubt in c# but i can say u what i da in vb first i fille the dataset using this code
in form class
dim bm as bindingmanagerbase

in form_load
dim da as odbc.odbcdataadapter
dim ds as dataset
da.fill(ds,"tablename")
textbox1.databind=ds(table(0).field(0))
bm=me.bindingcontext(ds,"tablename")
bm.position=0
in button_click (this button is next button)
bm.position+=1
end sub
Jan 22 '07 #4
seshu
156 100+
if the above code does not work and if you say that i dont mine using wizzard i can give you that even
Jan 22 '07 #5
hime
13
First of all thank u for ur reply,
but I tried to use the suggestions you gave me but it didn't work I will keep trying and actually I don't mined using any thing that will work, but I am not sure if wizard works with mysql and also I feel like many things doesn't work smoothly with mysql or more likely its me

thanks
Jan 22 '07 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Oliver Spiesshofer | last post by:
Hi, I have a script that calls an fopen() on an external URL. I can run the script from the server as an url fine. When however the script should be run from crontab, it does not work. I get ...
5
by: Catherine | last post by:
I am having a problem viewing asp pages on iis version 5.1 xp pro. HTML pages are viewable on http://localhost but .asp pages are not. I have created a test program called timetest.asp with the...
19
by: Allen Thompson | last post by:
sorry for the simple question, haven't done this in a while. when I use the following script it keeps displaying the value of "x" like a string. for example, if I type the number 7 in the prompt,...
4
by: Steve Westwood | last post by:
I have a WebForm button. Depending on calculation I wont to send a popup message to the web page. I am not sure of the approach. From the server side code I don't seem to be able to access the...
6
by: Dave Gehrig | last post by:
Hi guys, Using Access 2003 on XP. First time caller, long time listener. I am not a programmer per se, and all my training in coding in the past year or so has come from the wealth of info...
7
by: Christine | last post by:
My code has a split function that should split the text file of numbers. I've run this in previous programs as it is here and it worked, but now it wont work for some reason and returns...
5
by: Mr Newbie | last post by:
Debug.Assert( False, "Why wont I display ??") I am trying to use this in my code but it wont display. The app is running on my local machine and the above code under a button click event. What...
1
by: jparker | last post by:
I have been working with ASP classic on this current project im involved in. Well the problem im facing now is there is a page where a flash movie should play in a particular section on the page...
3
Frinavale
by: Frinavale | last post by:
Hi there, I am currently behind a firewall that wont let me send emails. As a result my smtpClient.send(emailMessage) wont work on my IIS but this method does work through the VisualStudio...
0
by: watashi | last post by:
Hello, This is on socket. i m using tcpclient and tcplistener task is when the "Active " button is pressed according to user choice tool should work as server or client. when "Inactive"...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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...

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.