16,004,686 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Javascript questions
View Visual Basic questions
View .NET questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by Scribling Doodle (Top 150 by date)
Scribling Doodle
23-Jun-17 8:57am
View
It's already inside a TryCatch clause. It simply says "String was not recognized as a valid DateTime"
Scribling Doodle
13-Jun-17 9:45am
View
If you can read correctly there is a problem very well explicit. Even done the tables so all people could understand what do I want. Thanks anyway but problem was fixed by Griff.
Scribling Doodle
9-Jun-17 12:15pm
View
That's the next step as I said in the comments. I start always this way so I can imagine my database while reading the code. Instead of reading tonnes of AddwitValues beneath it... It's simpler to read and more vulnerable yes. I will create the parameterized query now since It's all going great now.
Scribling Doodle
9-Jun-17 11:42am
View
Still the same error regarding the double value. Both comboboxes are suposed to give me a single number. Actually I have a table called Motive that has an ID for every motive.
Scribling Doodle
9-Jun-17 11:39am
View
I do this everytime because it's easier for me to understand the query... After that, I start creating the parameterized queries using cmd.AddWithValue("@1", cmbMotive.SelectedValue). I'll try to follow your steps and reach back to you with the result. Thanks in advance!
Scribling Doodle
5-Jun-17 9:26am
View
Both of them does not work, seems to give the same error.
Scribling Doodle
5-Jun-17 9:25am
View
Deleted
now it gives me a "not found" error while executing the byte constraint.
Scribling Doodle
5-Jun-17 9:15am
View
And what does that mean exactly? Should I change the element to another thing?
Scribling Doodle
5-Jun-17 8:14am
View
I've found a better solution to keep the integrity of the table on the email not so unusual. This one creates a more flat grid and works for datatables too
Scribling Doodle
5-Jun-17 7:56am
View
This code I used to use for Datagrid, my problem is that I cannot figure out a way to make it work for Datatables instead.
Scribling Doodle
5-Jun-17 4:17am
View
Since I directly want my application to retrieve the "link" to store it on a string, this way seems much more simple. Thanks in advance for the great answer!
Scribling Doodle
29-May-17 8:54am
View
byte[] thumbnail = thumb.GetBuffer();
SqlParameter tp = new SqlParameter("@d9", SqlDbType.Image);
tp.Value = thumbnail;
cc.cmd.Parameters.Add(tp);
What this actually means to you? I create a byte and store the value from the buffer. Then I create the sql parameter to insert it on the column thumbnail. After that I simply set the value of the var 'tp' to the have the same value as the thumbnail byte. After that I simply add it to the database as a parameter. Isn't that what's on the code? How can I not be using the value if this is exactly what I've made? The value is on the database, but it's not resized
Scribling Doodle
29-May-17 8:08am
View
It inserts the byte. But it's not resizing. That's my actual problem.
Scribling Doodle
29-May-17 7:07am
View
That's why I used "Technically". It simply should insert the same image as a thumbnail on the database for it to show on the datagrid without any excessive row height.
Scribling Doodle
29-May-17 5:53am
View
Technically I would insert it into the database. According to my needs, I simply need a thumbnail to stop the rows from being too large in terms of height.
Scribling Doodle
26-May-17 12:13pm
View
I store it on the d9 field that represents the thumbnail column in my database. I have a photo column and a thumb, but only the thumb should be during the view of all the data.
Scribling Doodle
26-May-17 11:30am
View
That's what I did, the actual code does insert the 2 images, but the thumbnail is actually inserting as the same resolution as the normal one, instead of 120x120 like I've done in the code.
Scribling Doodle
26-May-17 10:29am
View
Didn't quite understand your second part. I'm a beginner and I actually cannot seem to find a way to fix this problem. Could you be more explicit?
Scribling Doodle
24-May-17 9:30am
View
Yeah, you're right mate, thanks in advance!
Scribling Doodle
23-May-17 6:29am
View
Maybe you will need to translate since my table is entirely in Portuguese...
I'll update the question with the tables.
EDIT: Saw that article, and figured out what's wrong. Already posted an answer regarding your answer.
Scribling Doodle
23-May-17 6:18am
View
Yeah right, That's what i've done, i simply have the brand name called Name. I even changed the last part to c.brand = b.Name
Scribling Doodle
23-May-17 6:11am
View
Yeah, that's right, I'll try it out. The problem is that it's showing the value ID for the brand, instead of the real name. But i'll try it and see if that helped ;)
EDIT: Still showing the Brand ID, instead of the brand name. But the Sql syntax is working fine. It's not simply changing that '1' to Toyota.
Scribling Doodle
18-May-17 7:56am
View
I'll try using the .ToString("yyyy-MM-dd") to convert the date to the mysql default format. I'll catch up in a bit.
Scribling Doodle
18-May-17 7:47am
View
I rode that and I the datatype value I'm using it's the DATE so, the value with "dd-MM-yyyy" is accepted, but under the circumstances, it's not inserting the value as it should.
Scribling Doodle
18-May-17 7:46am
View
The problem is that the value referred to the dtpData.Value is selectin the short string date. If so it's giving date values like this (dd-MM-yyyy)
Scribling Doodle
18-May-17 7:08am
View
The basis is the same. I just used some functions instead of variables and declare it manually. Using functions are way cleaner and easier to work. Glad I found a way to use it the right way.
Scribling Doodle
12-May-17 11:37am
View
Yeah, I tested exactly that and that was what I came up with. Thanks for clarifying. Post it as an answer so I can accept it ;)
Scribling Doodle
12-May-17 11:24am
View
Can you tell me why do i need to convert the ID_REPORT to varchar if it is an auto increment number?
Scribling Doodle
12-May-17 11:16am
View
For example "SELECT ID-REPORT + "var" + CLIENT_NAME FROM ..."?
Scribling Doodle
12-May-17 11:13am
View
I'm using Winforms, but since I'm using * to select all the columns, how could I simply work out a joint between both columns? I also saw some c# things on this forum but all seem like Chinese to me tbh... Since I'm new to programming languages.
Scribling Doodle
12-May-17 10:45am
View
I came up with another idea, by using the "using clauses" I managed to do exactly what I wanted. Thanks anyway :)
Scribling Doodle
12-May-17 8:34am
View
I don't seem to find where I am wrong, that's why I came here. Can you tell me where I made any mistakes? Because I simply cannot find it...
Scribling Doodle
12-May-17 8:05am
View
How's that? I simply used the code from a previous program that I made and was working fine. Now on this one, it's not working idk why. want me to update my question and set the code from the other program that actually works?
Scribling Doodle
12-May-17 6:51am
View
on both da.Fill(dt). Now it gives me this error: "The property SelectedCommand has not been initialized before you call method Fill." Any ideas?
Scribling Doodle
12-May-17 6:45am
View
forgot to mention, it gives me this error on ds.Fill(dt). I'll try out some other variables and see if anything is out of line.
Scribling Doodle
8-May-17 6:43am
View
Sorry, didn't have time to come here and respond to you, but the problem was that it was giving me decimal values. I wanted the full week quocient. And with the answer from chill60, I could finally get it working ;)
Scribling Doodle
8-May-17 6:39am
View
Yeah, actually some weeks I need to work on the weekend, so even if I do not work on weekends most of the time, the value would be set to 0, and if I work it simply accepts it as a weekday. This worked very well my friend.!
Scribling Doodle
4-May-17 3:47am
View
What I did to minimize the impact on the memory spent dealing with this tasks was simply create a column called thumbnail and simply resize the image to a 100x100 image and then instead of converting the real image and processing the thumbnail directly on the datagrid, it simply loads the thumbnail photo, leaving me much more memory for other tasks. Thanks in advance.
Scribling Doodle
2-May-17 8:05am
View
So, by your logic, I should create a thumbnail column, and then resize the image programmatically and then insert into the thumbnail column. Is that what you're saying?
Scribling Doodle
2-May-17 6:18am
View
Done, Actually I do not have any thumbnail, but as I was thinking, The size wouldn't really matter, because the picturebox can resize to it's actual size. Instead I was simply thinking about resizing the image and insert it in the database and then the picturebox would stretch it out on the Updating form. Would this be a good ideia?
Scribling Doodle
28-Apr-17 12:48pm
View
MSSQL has any diference from those you said?
Scribling Doodle
27-Apr-17 10:11am
View
I'll try, and already edited the question, since I was testing out some values, I forgot about that 10... But already changed it.
Scribling Doodle
27-Apr-17 10:08am
View
5, 10, 30 it's the same thing... I forgot to edit that since I was testing some stuff. I'm sorry.
Scribling Doodle
23-Mar-17 8:07am
View
Yeah, thanks for your response! It worked flawlessly!
Scribling Doodle
16-Mar-17 8:47am
View
Yeah, but the only method I've learned was related to rows, not cells. Without further a do, I would like to thank you for your reply.
Scribling Doodle
15-Mar-17 9:23am
View
I already put a code snippet for you to see what i came up with.
Scribling Doodle
15-Mar-17 8:49am
View
I'll work it out in a few minutes ;) Thanks in advance!!
Scribling Doodle
15-Mar-17 8:38am
View
And Yes, it's something like that but the end date comes from the datagrid, if so i would do a string for the endday and set it up as the datagrid column?
Scribling Doodle
15-Mar-17 8:37am
View
Daily Basis, It's a subscription program for a Gym. Which needs constant updates on the end dates, so the worker can warn the people.
Scribling Doodle
15-Mar-17 8:30am
View
I have 2 separate dates, the today's date and the end date of that subscription. What I want is simply remind me 5 days before the end date is equal to the today's date. It's kinda confusing yeah, but I hope you understand!
Scribling Doodle
7-Mar-17 10:07am
View
Really helpful! Thanks once again for your knowledge!
Scribling Doodle
7-Mar-17 5:44am
View
Thank you very much sir. I understood everything you said and it makes sense. Thanks for your answer
Scribling Doodle
4-Feb-17 11:10am
View
Did that and did not work. If I manualy insert the values in the database it's all fine. But if I use my interface it won't work.
Scribling Doodle
4-Feb-17 11:06am
View
I've checked it already and it seems all fine, but this CM_ID wont accept values like I{number}. Even if I change it to varchar.
Scribling Doodle
4-Feb-17 10:46am
View
My main problem is with the CM_ID which is set to be a string, but for every function like stocks or even clients, i have ST-{number} for stocks and C-{number} for clients, and all of the other forms are working correctly, this one is giving me a pain in the ass...
Scribling Doodle
23-Jan-17 4:46am
View
I say that because i use parameterized queries in c# and since i know how to deal with those, i think in this simple case it is not needed, but thanks for your response!
Scribling Doodle
19-Jan-17 7:08am
View
As stated before i have many examples made by myself on c# but unfortunately i cannot simply convert them, and that's a problem. I'm trying to create the same thing based on the logical stuff and the meaning of my problems. Thanks in advance for your response!
Scribling Doodle
19-Jan-17 7:05am
View
This is a test because i do not plan to make this project active, since i will use oracle in the future, this is sort of a first try at creating a simple login form so i can test some modules and the functions from the language itself. Thanks in advance for your response!
Scribling Doodle
17-Jan-17 11:08am
View
At the moment i do not need any kind of protection, since this is only a test. I've done some programs on c# and I intend to keep passwords on strings instead of plain text, but thanks anyway for your help! Glad for your help.
Scribling Doodle
17-Jan-17 10:44am
View
I'll try that, thanks in advance!
Scribling Doodle
17-Jan-17 10:27am
View
Do you have any idea how to make it?
Scribling Doodle
9-Mar-16 10:56am
View
i simply want the record to delete the last record known by the program. Data wont work because it doesn't store the seconds... So, it wont be useful. For example, if i have 2 values with 2:30 PM it will delete both, so i wanted it to delete it by record id, which is called "id_entrada"
Scribling Doodle
9-Mar-16 10:54am
View
i'm ordering by highest record id, not the vehicle id. The Vehicle id is called "id_veiculo". Two separate things
Scribling Doodle
9-Mar-16 10:46am
View
I did run the SQLyog and forgot to insert it, its already there. Check it.
Scribling Doodle
9-Mar-16 6:34am
View
that's what i tought... With that last example i was confused as f***, because it didn't made sense on where to put it. But yeah, you always save my day xD One advice, never give code like that, so people wont learn anything, i prefer a good explanation then a piece of code ;) Thanks once more dude! 5*
Scribling Doodle
9-Mar-16 6:10am
View
this "row.Cells[0].Style works for both methods? or i'll have to use that foreach loop too to make it able to work?
Scribling Doodle
9-Mar-16 3:40am
View
I'll post a answer that resolved my problems. No need for stored procedures or anything like that. The problem atm is that the grid wont force the refresh with the Grid1.Refresh(); neither Grid1.Update();
Scribling Doodle
8-Mar-16 11:14am
View
still nothing xD Just answer this... I got a grid called Grid1, how do it get the value from the selected cell on row index and use it as a value to update a database?
Scribling Doodle
8-Mar-16 10:32am
View
LOG:
Operation failed: There was an error while applying the SQL script to the database.
Executing:
USE portaria
INSERT INTO `entradas`(datasai, horasai) VALUES(date(now()) ,time(now()));
ERROR 1064: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'INSERT INTO `entradas`(datasai, horasai) VALUES(date(now()) ,time(now()))' at line 2
SQL Statement:
USE portaria
INSERT INTO `entradas`(datasai, horasai) VALUES(date(now()) ,time(now()))
Scribling Doodle
8-Mar-16 9:05am
View
now it doesn't have any error but doesn't do anything xD It's confusing...
Scribling Doodle
8-Mar-16 8:39am
View
So, what is the fix for this procedure? Will i need to setup in the correct order? or what?
Scribling Doodle
8-Mar-16 6:57am
View
It just shows me this error... Additional information: Parameter 'ID_VEICULO' not found in the collection. What can i do about it?
Scribling Doodle
8-Mar-16 6:56am
View
using (var cn = new MySqlConnection("server=localhost;user id=root;password=12345;persistsecurityinfo=True;database=portaria;allowuservariables=True"))
{ My connection string is allright... It works on the other querys... Just on this procedure it's giving me headache...
Scribling Doodle
8-Mar-16 6:41am
View
in mysql wb it retrieves the error 1046. I'm kinda tired of trying all the possible ways and none does the job...
Scribling Doodle
8-Mar-16 6:26am
View
And this cmd.Parameters that i have were sent by you on another question, that's why i think you were right. And it worked well to insert all values where sai was equal to 0 and change them all to 1... But i want only to set the selected row to sai being equal to 1. And no, id_veiculo is not a int. It's a masked varchar45. It's made to insert the licenseplate. And it acts as an identifier for the vehicle. Not as an integer :)
Scribling Doodle
8-Mar-16 6:23am
View
after i change that @id_veiculo to @veiculo and on the code parameter set it to @veiculo it just gives me an error where the "ID_VEICULO" Could not be found.
Scribling Doodle
8-Mar-16 6:19am
View
the res var is just giving null values. Not 0 or 1.
Scribling Doodle
8-Mar-16 6:17am
View
The only problem is this seems to not show any errors... it wont just insert the values. Thats all :/
Scribling Doodle
8-Mar-16 5:47am
View
I'll edit the question and show up my actual code for it. I did that and still not working...
Scribling Doodle
8-Mar-16 5:18am
View
didn't understood that "replace your reference to the grid with the sql parameter". Can you be more clear? Thanks!
Scribling Doodle
8-Mar-16 5:03am
View
No error shown... It looks like it executes the command but doesn't insert the value into database... I don't really know what's the problem here...
Scribling Doodle
8-Mar-16 4:59am
View
Re-organized the question.
Scribling Doodle
8-Mar-16 4:30am
View
it doesn't make sense writing the query 2 times. I think anyone could see by the topic that this was what i've tried. And didn't work. Thanks anyway.
Scribling Doodle
8-Mar-16 4:27am
View
I'm using c# 6.0 not asp.net. Not much into it, im working on winform and WPF.
Scribling Doodle
8-Mar-16 4:26am
View
i tried this sqlquery that i got... Here you got your answer.
Scribling Doodle
7-Mar-16 9:00am
View
The update query should do this:
Search for the value id_entrada on the table entradas;
Insert it on table saidas on the column id_entrada;
Insert both, date and time, of the current date and time on data and hora and insert the value id_entrada from entradas on id_saidas from saidas;
Then i want it to set the value of sai to 1 when it checks if the value on id_entradas correspond to id_entradas on table saidas.
Got it? ;)
Scribling Doodle
7-Mar-16 7:19am
View
I'll explain better... I have this insert statement that will insert the values on the table "saidas" (INSERT INTO SAIDAS(data, hora, id_entrada) VALUES(date(now()) ,time(now()), id_entrada);) But i want it to add on id_entrada the value of id_entrada on table entradas. And then use that update syntax to look for the id_entrada on datagrid and change it according to the table "saidas"
Scribling Doodle
7-Mar-16 7:12am
View
Hmm fine! It helps alot. One more thing, i have this update syntax: "UPDATE ENTRADAS SET SAI=1 WHERE ID_ENTRADA= @id_entrada;" But how can i use it to check the ID_entrada from the table "entradas"?
Scribling Doodle
7-Mar-16 4:14am
View
But one thing i didn't quite understood, cmd.Parameters.AddWithValue("@retcode", MySqlDbType.Int32);
cmd.Parameters["@retcode"].Direction = ParameterDirection.Output;
what this "retcode" stands for?
Scribling Doodle
7-Mar-16 3:55am
View
Yeah it worked as good as it looks! Thanks once more ;)
Scribling Doodle
4-Mar-16 9:52am
View
And yes, i got some help from Griffin, but that doesn't matter... i've done a code, and he simplified my code, just that. this question was for him but i accept everyone who wants to help. This is a project for my last exam, i can do anything related to computers... I decided to create a parking lot system. With the help of community, i've made this far. Just that, nothing personal against you or anything like that. But yeah, i've done this code from the ground 0.
Scribling Doodle
4-Mar-16 9:49am
View
Yes i did this code, you can check all my questions, i've made it, but since my skills of c# aren't that great. I asked for help. Instead of saying that just inform yourself first. Thanks for the reply! Have a nice day :)
Scribling Doodle
4-Mar-16 9:25am
View
well, I'm not much into it xD Could you give me a "light" on this one? ;)
Scribling Doodle
4-Mar-16 9:19am
View
You didn't understood, i just want to update one value on table "entradas" which is "sai" to value 1 on button click, and to insert the "data" and "hora" on the table "saidas"
Scribling Doodle
4-Mar-16 6:20am
View
off-topic: would you mind to check my new question? i'm having troubles in other circumstances :p Hope you can help me ;)
Scribling Doodle
4-Mar-16 5:38am
View
Done.
Scribling Doodle
4-Mar-16 5:30am
View
I have several tables, "entradas", "saidas" and "veiculos". The table "entradas" has the related fields at the entrance of vehicles, the table "saidas" only records the output of vehicles have entered on "entradas". Then I have the table "veiculos", which supposedly is a filter if the text in "msktxtmat" is equal to a value in the column "id_veiculo" it inserts the parameter "@tabempresa" the value of "id_empresa" column of "veiculos" table. My question is how do i change my actual code to fit this needs? Thats my main problem, because i've done this way and now it doesnt fit the needs of my project. It's a project for school btw.
Scribling Doodle
4-Mar-16 5:22am
View
Im not asking anything in particular, im asking for some help to rebuild this piece of code, since i dont really know much about c# yet. :/
Scribling Doodle
4-Mar-16 5:15am
View
i just went to your profile and clicked on g+ icon and it show'd me a windows to invite you to chat, just that xD :p But well, here it is the topic: http://www.codeproject.com/Questions/1083091/Fluxogram-explaining-what-im-trying-to-do
Scribling Doodle
4-Mar-16 5:05am
View
i'll do it right now. Would you mind to accept the invite on hangouts? so i can chat with you someday? ;)
Scribling Doodle
4-Mar-16 4:44am
View
i know its too confusing, i'll just send you a PM with a fluxogram of what i'm trying to do.
Scribling Doodle
4-Mar-16 4:43am
View
i have another question, if i want all the values from datagrid to show on only 1 tab and have a license plate filter, to add the values to @tabempresa according to a database which contains the license plates from the companies inside this system. How hard would it be?
Scribling Doodle
4-Mar-16 3:42am
View
Thanks griff, you really helped me alot, adn chill too, i figured a way out, according to your methods ;) Thanks for the time given. Since i'm a newbie and you have more things to do then help, i appreciate all the effort in to this post. From the bottom of my heart, thanks!
Scribling Doodle
4-Mar-16 3:40am
View
i haven't accepted it yet so more people could see this topic, as it could help someone with the same problem ;) But i'll accept it right away. Thanks for the time given
Scribling Doodle
3-Mar-16 12:22pm
View
http://pastebin.com/57CebMJJ Fixed it ;) now it works as it should be :p
Scribling Doodle
3-Mar-16 12:09pm
View
Not it doesnt show me any error, but most of the data that i insert gets nulled on the database... This is the code i have, and after its an image of my database table.
Code: http://pastebin.com/076fxRhC
Database: https://gyazo.com/dbf8c3907ebf7b1d72c3abd568db8331 (It is missing 2 columns, @nomecondutor and @sector, but both have null value)
Scribling Doodle
3-Mar-16 12:00pm
View
you're a f***ing genius! Thank you so much for this explanation, i understood all with this simple steps, one thing i couldnt understand was this last paragraph where you say that will be routes through my code that cant assign values to the parameters @matricula or @data...
Scribling Doodle
3-Mar-16 11:54am
View
But since i only have 7 items on my checkbox, why would i use all the circumstances if i only use that 7 items? I'm so confused...
Scribling Doodle
3-Mar-16 11:50am
View
the value sai is an int, based on 0 or 1, i wont use bool because on future it might have more values, for some reason.
Scribling Doodle
3-Mar-16 11:48am
View
ill try it, thanks!
Scribling Doodle
3-Mar-16 11:45am
View
How should i do it then? I'm trying to follow all the steps but im so confused, i can speak barely english but understanding all he said at once is a bit difficult :/ Any simplier explanation? Glad to ear from both!
Scribling Doodle
3-Mar-16 11:35am
View
i set @sai at parempresas, where i use it in empresascondition, which are both connected right? So, if i execute empresascondition it will execute parempresas, which has @sai value set to 0. Any sugestion on how i can fix it?
Scribling Doodle
2-Mar-16 11:55am
View
Yeah, thank you so much dude! I've figured a way faster then indexes, created a table to store all data and be accessed when they want to check older data, and this new one is to store the daily data, which is directly connected to the old one, making it easier to insert data, but slower to search, but its fine for now ;)
Scribling Doodle
2-Mar-16 7:04am
View
i have 2M+ records on my database, is that a problem? I have no indexes because i dont know how to use them. The date field is called "data" as you wrote, it belongs to a.data
Scribling Doodle
2-Mar-16 4:04am
View
im creating a parking lot system that requires much data, to know who entered and who left, per day my parking lot has arround 10k+ users joining and leaving. this is the data from the 1st day i began this project, since 2011 or so.
I want my employees to be able to track every car that was here and still is, thats why requesting 250k+ values.
Scribling Doodle
2-Mar-16 3:38am
View
i keep gettng timeout exceptions because my main tables have 250k+ rows, which can cause some troubles. I'll give a try about threads
Scribling Doodle
1-Mar-16 12:26pm
View
What do you mean by "locking the tables"?
Scribling Doodle
1-Mar-16 11:16am
View
Alright, thanks dude! ;)
Scribling Doodle
1-Mar-16 10:17am
View
Check this printscreen, that's what i'm trying to do. https://gyazo.com/56c1afc8aa9436a58a833c133dc3e44b
I want to "CONCAT" the columns data and hora to a column called "entrada" and data1 and hora1 to "saida"
Scribling Doodle
1-Mar-16 8:55am
View
i'm confused right know, you mean that's impossible to use tabcontrol.SelectedIndex according to my needs?
Scribling Doodle
1-Mar-16 8:44am
View
One more question, is it possible to show only values where the date is less or equal to the "current date"? For example, i have 10 values between 10-10-2014 and "current date" and i want to show the values on a daily basis. With that in mind i will only have in this case the values from 29-02-2016 and 01-03-2016.
EDIT: This NAMED query seem to create an exception timeout problem, is any way to fix it?
Scribling Doodle
1-Mar-16 8:40am
View
Thank you so much dude! God bless ya!
Scribling Doodle
1-Mar-16 7:37am
View
Yeah it works now, but i have a problem... I want the table to show like on this printscreen, how am i gonna do it? https://gyazo.com/56c1afc8aa9436a58a833c133dc3e44b
Scribling Doodle
1-Mar-16 7:21am
View
https://gyazo.com/fce36c6b8c311d33e70ba1721b84bfe8 Here you can see all the tables i have, the 2 that have the columns are the ones i want to use to show data in my datagrid. Hope it helps :)
Scribling Doodle
1-Mar-16 7:15am
View
The sql query doesn't work, what could be the problem here? I want to filter data from 2 tables, one that has the car join values and the exit values, in "DATA and HORA" i want it to be joined like car joined at 13.3.2016 / 22:15 and left at 14.3.2016 / 22:15
Scribling Doodle
1-Mar-16 7:12am
View
Do i need to use "inner join" or "full join" to work? I'm not much into sql join structure...
Scribling Doodle
1-Mar-16 6:06am
View
My problem is that it doesnt show up the tabcontrol object. Because its on another form... How can i sort of "import" the tabcontrol of one form to another? That's a bigger question :/
Scribling Doodle
1-Mar-16 5:57am
View
i have several tabs, each one according to a company with an id which is on another form, for example... I have a tab with selectedindex value of 1, and i want to be able to set that 1 into my database on the other form. Like textbox use textBox1.Text to insert the value from the textbox into database, i want the selectedindex value, residing in another form.With that in mind i want to be able to insert in my database the SelectedIndex value of the selected tab, need more explanation? Glad to ear from you soon!
Scribling Doodle
1-Mar-16 5:33am
View
my application requires a programaticaly tabcontrol to add new tabs with companies that have a unique id that is filtered from the database, that's why.
Scribling Doodle
1-Mar-16 4:07am
View
yeah, figured it out, sometimes we dont see that the error is in front of out eyes :p
Scribling Doodle
1-Mar-16 3:59am
View
Yeah, i've figured it out, but now it comes with another type of mysql error, not the same since this one is fixed, but now it shows me that "column count doesn't match value count at row 1"
Scribling Doodle
29-Feb-16 10:14am
View
how it should be then? @nome_empresa_id_empresa? or keep the @name_id?
I'm really confused... I have a table which has a name and id for each company, but how can i tell my program that it should insert the id and not the name shown at the combobox? Could you help me out here please?
https://gyazo.com/ba5b1ce46780ae64c3e6a81da86f8b20
this is the default proprieties of combobox
Scribling Doodle
29-Feb-16 5:10am
View
Ok, thanks anyway my friend! :)
Scribling Doodle
29-Feb-16 5:04am
View
i couldnt even complete the 1st step :/ Here is what i got so far...
Prints:
https://gyazo.com/edd41bd32f3020915706f88051f2ad86
And this is the code i have so far:
namespace Portaria
{
public partial class Inicio : Form
{
public Inicio()
{
InitializeComponent();
}
private void toolStripComboBox1_Click(object sender, EventArgs e)
{
}
private void Grid_CellContentClick(object sender, DataGridViewCellEventArgs e)
{
}
public void Gridprop()
{
Grid1.Columns[0].Visible = false;
Grid1.Columns[2].Visible = false;
Grid1.Columns[1].HeaderCell.Value = "Matricula";
}
private void LoadGrid()
{
this.WindowState = FormWindowState.Maximized;
string _con = "server=localhost;user id=root; password = 12345; persistsecurityinfo=True;database=portaria";
string _query = "SELECT ID_TEMP, ID_VEICULO 'Matricula', ID_EMPRESA, (DATAENT+HORAENT) 'Entrada', (DATASAI+HORASAI) 'Saida',VISITADO 'Pessoa Visitada' , EMPRESA_VISITANTE ' Empresa Visitante', EMPRESA_VISITADA 'Empresa Visitada',(OBSENT+OBSSAI) 'Observações' FROM temp_reldiario WHERE id_empresa=" + tabControl1.SelectedIndex +";";
MySqlConnection Con = new MySqlConnection(_con);
MySqlCommand Command = new MySqlCommand(_query, Con);
MySqlDataAdapter sda = new MySqlDataAdapter();
DataTable dt = new DataTable();
sda.SelectCommand = Command;
sda.Fill(dt);
try
{
Con.Open();
DataView dv = new DataView(dt);
Grid1.DataSource = dv.Table;
Grid1.AutoGenerateColumns = true;
for (int i = 0; i < Grid1.Columns.Count - 1; i++)
{
Grid1.Columns[i].AutoSizeMode = DataGridViewAutoSizeColumnMode.AllCells;
}
Grid1.Columns[Grid1.Columns.Count - 1].AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
for (int i = 0; i < Grid1.Columns.Count; i++)
{
int colw = Grid1.Columns[i].Width;
Grid1.Columns[i].AutoSizeMode = DataGridViewAutoSizeColumnMode.None;
Grid1.Columns[i].Width = colw;
}
Con.Close();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}
private void tabControl1_Selected(object sender, TabControlEventArgs e)
{
}
private void Form1_Load(object sender, EventArgs e)
{
LoadGrid();
Grid1.Show();
Gridprop();
TabControl();
}
public void TabControl()
{
ToolStrip ts = new ToolStrip();
ts.Dock = DockStyle.Top;
ts.RightToLeft = RightToLeft.Yes;
ToolStripButton ToolStripButton = new ToolStripButton("X");
ts.Items.Add(ToolStripButton);
ToolStripButton.Click += new EventHandler(ToolStripButton_Click);
/*tabControl1.TabPages[currenttabpage].Controls.Add(ts);
*/
}
void ToolStripButton_Click(object sender, EventArgs e)
{
ToolStripButton t = (ToolStripButton)(sender);
ToolStrip ts = t.Owner;
TabPage tb = (TabPage)
(ts.Parent); tabControl1.TabPages.Remove(tb);
}
private void cmdEntrada_Click(object sender, EventArgs e)
{
}
private void toolStrip1_ItemClicked(object sender, ToolStripItemClickedEventArgs e)
{
}
private void Grid1_CellContentClick(object sender, DataGridViewCellEventArgs e)
{
}
private void toolStrip
Scribling Doodle
29-Feb-16 4:22am
View
I didnt quite understood all this steps, could you explain it more clearly? Thanks in advance!
Scribling Doodle
29-Feb-16 3:47am
View
I'm using the latest version of mysql, i just wanted for a pre-built schema so i could look arround- My point is not to copy, but to learn and improve what's been given. That's what im looking for, thanks in advance.
Scribling Doodle
16-Feb-16 6:46am
View
as i wrote i want to retrieve data which contains the word on the tabcontrol text. No matter what its writen. For example, i click on a tab that has Eleven, it will show all the rows that contains Eleven on a certain column.
Scribling Doodle
27-Jan-16 9:32am
View
Thanks for the information! :)
Scribling Doodle
27-Jan-16 6:08am
View
In my case i would like to do like the example i gave, i setup all the comboboxes on my form and then when i press a button it would insert the values and that especific value into the database as a value of 0 if "false" and 1 if "true", only that. :)
Scribling Doodle
27-Jan-16 6:03am
View
I couldnt understand one thing, this piece only works for the value true? or it works for both values?
Scribling Doodle
27-Jan-16 5:58am
View
I understood how it works but i couldnt figure a way to setup my code correctly, could you give me a hint or so? Thanks in advance!
Scribling Doodle
27-Jan-16 5:37am
View
I couldn't understand what msdn had in that topic, that's why i asked for a sample code according to my needs. Thanks in advance!
Scribling Doodle
27-Jan-16 5:08am
View
Can you show me a example code with the information given so i can understand where to put everything in the right place? Thanks in advance!
Scribling Doodle
26-Jan-16 12:14pm
View
Alredy figured a way out! Thanks anyway!
Scribling Doodle
26-Jan-16 12:14pm
View
alredy figured a way do do it. thanks anyway!
Scribling Doodle
26-Jan-16 11:23am
View
Please change the Tags from C# to vb.net because the code you're showing here is for visual basic and in c# i think you will not get the help you might want. Thanks in advance!
Scribling Doodle
21-Jan-16 12:02pm
View
Alredy figured it out, needed to create a public string and attach it to the both forms, all working now sir. Thanks anyway
Scribling Doodle
21-Jan-16 9:20am
View
i've tryied bindings, but no success atm
Scribling Doodle
20-Jan-16 10:53am
View
Thanks for the advice, i've figured it out how to fix the 2 problems on the same way.
Scribling Doodle
20-Jan-16 10:21am
View
That didn't respond to my question, thanks anyway for the advice!
Show More