|
hello
I am debutant in C #, and I would like create a Windows application which makes it possible to manage a data base.
charge information in textBoxs, button first , previous, last, and allow the modification, the suppression.
thanks for help
|
|
|
|
|
almora007 wrote: thanks for help
Since you didn't actually ask a question, I'm curious about what help you expect.
Going by your description you have given an overview of the application you are planning to build. You haven't identified any specific problem areas. What would you like help with?
-- Always write code as if the maintenance programmer were an axe murderer who knows where you live.
Upcoming FREE developer events:
* Glasgow: Agile in the Enterprise Vs. ISVs, Mock Objects, SQL Server CLR Integration, Reporting Services, db4o ...
* Reading: SQL Bits
My website
|
|
|
|
|
thank for your response
i see your point.
i explaine my probleme,
i have my database table and i dont now how to bind button te permet the user of the application traversing the table.
|
|
|
|
|
almora007 wrote: i have my database table and i dont now how to bind button te permet the user of the application traversing the table.
You can't bind a button to do that. You have to create an event handler for the button and then write the code to traverse the database.
To create an event handler: Double click the button in the designer. Visual Studio will create an event handler if one does not already exist and take you to that code. You then have to fill in the code yourself.
It is up to you how you want to traverse the data. I'm guessing you have a DataSet somewhere with a populated DataTable in it. You need to store a index to the row in the table somewhere and when the button is pressed the index is updated, you can then get the data from the row at the new index and populate your texts boxes and other controls.
-- Always write code as if the maintenance programmer were an axe murderer who knows where you live.
Upcoming FREE developer events:
* Glasgow: Agile in the Enterprise Vs. ISVs, Mock Objects, SQL Server CLR Integration, Reporting Services, db4o ...
* Reading: SQL Bits
My website
|
|
|
|
|
|
Hi there, how do you insert data from an access database into a label I have a select sum statement and want to insert that value into the label please help. thanks
|
|
|
|
|
|
|
He assumed you were asking an ASP.NET question. As it stands, I'm not sure where the issue is. A label has a Text property. Do you not know how to query your database ?
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
I am doing it in C#, and I did a test to insert that value into a listBox and it worked I just want to know how to insert it into a label.
|
|
|
|
|
myLabel.Text = someValueFromTheDatabase;
-- Always write code as if the maintenance programmer were an axe murderer who knows where you live.
Upcoming FREE developer events:
* Glasgow: Agile in the Enterprise Vs. ISVs, Mock Objects, SQL Server CLR Integration, Reporting Services, db4o ...
* Reading: SQL Bits
My website
|
|
|
|
|
I also need to write a select sql statement which searches through a number of tables. As a start I ahve this which doesn't work.
string sql = "select employees.Firstname from employees where employees.Firstname = '" + empNamecomboBox.SelectedValue.ToString() + "'"; where RoleID = '" + rolecomboBox.SelectedValue.ToString() + "'";
I've got a winform with 5 fields, either comboboxes or checkedlistboxes.
i want to find all employees where a role or/and manager and/or division is selected. In other words I want to find all employees who are a developer with certain skills.
At the moment I can only get them working one at a time but the search doesn't display employees, it just displays the data on the role itself, or the division itself if that makes sense. ?
|
|
|
|
|
1. Don't mark your questions as urgent - do you think anybody cares?
2. The snippet you posted will not even compile.
3. If you want to test it, set a breakpoint, see what your query comes out like, and try executing it from Query analyzer.
4. Use stored procs or at least parameterized queries - you are exposing yourself to SQL injection attacks.
Cheers,
Vıkram.
Be yourself, no matter what they say.
- Sting, Englishman in New York.
|
|
|
|
|
Sorry that doesn't really help me. I have got two hours to finish this project and my managers don't care about injection attacks because they are purely testing me on the ability to search with sql queries. This is not being used. Why is everyone so rude on this forum.
If no one cares, why are you all even on the forum. they should have people on who do care.
|
|
|
|
|
falles01 wrote: Why is everyone so rude on this forum.
falles01 wrote: If no one cares, why are you all even on the forum.
If somebody is rude, than it's you!
falles01 wrote: they should have people on who do care.
Who, do you mean?
Do you think somebody get piad to answere questions here?
The answere is, No! It's all volunter, and you should be thankfull for every answere you get!
I voted '1' for your rudeness!
All the best,
Martin
|
|
|
|
|
I apologise. I didn't realise it was voluntary,,and I didn't mean you because I thought you had been quite good, I just have had a few responses to my questions, like one I just received saying 'do you think anyone cares that you have a deadline' and a few days ago one saying 'you shouldn't be writing code that anyone can expect to pay for.' now if they aren't rude I don't know what is.
|
|
|
|
|
falles01 wrote: I didn't realise it was voluntary
Had it been a paid efforts, have you ever can dream of walking into the forum and post your troll?
You should first read this before posting questions on public discussion boards:
http://www.codeproject.com/scrapbook/ForumGuidelines.asp[^]
|
|
|
|
|
falles01 wrote: like one I just received saying 'do you think anyone cares that you have a deadline'
Obviously. When you say 'Urgent!' it implies we should drop whatever we're doing (mostly, it's work I'm being paid for) and solve your problem (for which I'm not). This is rude. You may not agree with me now, but be an active member for a year or so and you will agree.
Don't take it so personally.
Cheers,
Vıkram.
Be yourself, no matter what they say.
- Sting, Englishman in New York.
|
|
|
|
|
falles01 wrote: Sorry that doesn't really help me. I have got two hours to finish this project and my managers don't care about injection attacks because they are purely testing me on the ability to search with sql queries.
Sounds like the interview tests my company uses. And, I would be concerned about SQL Injection Attacks.
-- Always write code as if the maintenance programmer were an axe murderer who knows where you live.
Upcoming FREE developer events:
* Glasgow: Agile in the Enterprise Vs. ISVs, Mock Objects, SQL Server CLR Integration, Reporting Services, db4o ...
* Reading: SQL Bits
My website
|
|
|
|
|
Colin Angus Mackay wrote: I would be concerned about SQL Injection Attacks
I already mentioned so in a more recent post :->
"Try asking what you want to know, rather than asking a question whose answer you know." - Christian Graus
|
|
|
|
|
I am not sure why you are replying to my post from almost a month ago. Thats all in the past now. That was a very old question.
People had already told me off.
|
|
|
|
|
The OP said it wasn't important because it was a test. I was referring in the context of the interview tests my company uses. I would be concerned that a person did not account for SQL Injection attacks when they go through that test.
|
|
|
|
|
falles01 wrote: because they are purely testing me on the ability to search with sql queries
Obviously, they're testing you, not us. What's the point of giving your managers our answers?? Sure, "we" might pass this test for you, but "you'll" fail in the real world when you can't apply the concepts yourself.
|
|
|
|
|
falles01 wrote: why are you all even on the forum. they should have people on who do care
We are here to help when we can. We are not paid to be on these forums.
falles01 wrote: I have got two hours to finish this project and my managers don't care about injection attacks
That is not anyone's problem around here. Maybe you need a new manager.
"Try asking what you want to know, rather than asking a question whose answer you know." - Christian Graus
|
|
|
|
|
Gosh - didn't they even give you a book on SQL ? Have you not had time to read about SQL using google or something ?
I suggested a few days ago that any SQL you write, you should test directly against your database to get the best possible error info. In this case, your SQL is plain wrong. To combine two conditions, use 'and', and to combine two tables, use joins. Something like ( this won't work )
select e.firstname from employees e inner join roles r on e.roleId = r.RoleId where e.FirstName = 'fred' and r.roleId = 4
Not sure if you have a role table, what you need it for, if you're not looking anything up in it. I mean, if you cannot join the two tables, then you can't use them together, and odds are that it's a lookup table for role names, so you can then expect the role id to be in both tables, and you can look it up in the employee table.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|