15,900,973 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 Python 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 Ziee-M (Top 172 by date)
Ziee-M
8-Nov-18 3:26am
View
I complete the whole process in les then 3 min. i also log a msg on session_end event.
I dont think it is related to timeout.
Ziee-M
7-Nov-18 10:12am
View
Based on your comment, its seems you are pretty sure that a session variable can NOT be deleted individualy, can you confirm?
For your answer, no, there is not, the session is only set in a unique page, and only once, after the process is completed, the user can click a button to restart the whole process, in this particular case, instead of getting data from post request (xml data) like the first execution, we get them from the session instead, and the process restarts.
Ziee-M
7-Nov-18 9:09am
View
No, there is not.
Ziee-M
7-Nov-18 8:20am
View
The wired part, is that sometimes it work, other times it does not... while the code have not been changed at all.
Do you think it is possible for a unique session to be set to null while other are not?
Ziee-M
18-Jul-18 9:57am
View
You just have to set the id field as autoincrement in your table, the database will automaticaly increment the values when you insert new row.
Since its autoincrement, you dont have to pass the id.
here is w3 link : https://www.w3schools.com/sql/sql_autoincrement.asp
Ziee-M
18-Jul-18 9:44am
View
Yes, i think i got the idea.
Here is an idea how to achive this, in your producer app, you fill a file when hotkey entered.
In the consumer app, using a stopwatch, you can check if that file have been updated and show the data you need in it.
You can also use a thread in your consumer app, but it will conume much more ressources.
Ziee-M
18-Jul-18 9:11am
View
Making multiple SqlParameters does not make sense to me, because, a table has always the same number of parameters.
Basically, you should have a unique parameter parser for all of your CRUD method, and reuse it.
In case a paramter is not applicable, you should set a default value for that specific param or just ignore it(you should set that field nullable in the database level)
Ziee-M
18-Jul-18 5:47am
View
We need more of your code(html/codebehind).
A rapid guess with not enought information, your first line of code return null since the Rows(0) is the header row. you have to get data from second row.
You have to use debuging tools to find the problem.
Ziee-M
18-Jul-18 5:46am
View
Deleted
We need more of your code(html/codebehind).
A rapid guess with not enought information, your first line of code return null since the Rows(0) is the header row. you have to get data from second row.
You have to use debuging tools to find the problem.
Ziee-M
18-Jul-18 5:19am
View
You should also check the comment posted by Richard, your code is vulnerable to Sql injection, there are many diffrent way to achive this, by using an ORM such as EntityFramework, or search for SqlParameter to insert your parmaeters in the sql query instead of hard coding them
Ziee-M
18-Jul-18 5:14am
View
First add and generate your event for the second dropdown :
<asp:DropDownList ID= "TxtWarehouseInsert" runat="server" AutoPostBack="True" OnSelectedIndexChanged="TxtWarehouseInsert_SelectedIndexChanged">
Next, in the your new event, save your data to your datbase. You can get the dropdown text/value with TxtWarehouseInsert.SelectedValue/TxtWarehouseInsert.SelectedText
Ziee-M
18-Jul-18 3:20am
View
Deleted
By the way, i dont think its possible to achive this witouhout modifying both apps (just in case you intend to do all the work only in one app)
Ziee-M
18-Jul-18 3:17am
View
If i did understand, you have either to make your diffrent apps communicate based on hotkeys events, or implement Hotkeys in your target App. the later is certainly the easiest.
What are the technologies you use (Winforms, WPF or other)?
Ziee-M
17-Jul-18 9:34am
View
You should have set this comment as an answer.
Ziee-M
16-Jul-18 12:05pm
View
Where do you fill your object 'LsLotto'? Also, in your comment under the solution below, is the tuple null, or its list is null?
Ziee-M
16-Jul-18 12:05pm
View
Where do you fill your object 'LsLotto'? Also, in your comment under the solution below, is the tuple null, or its list is null?
Ziee-M
16-Jul-18 11:23am
View
did you instanciate your background worker?
BackgroundWorker Worker = new BackgroundWorker();
Ziee-M
16-Jul-18 11:22am
View
I think you have an issue elsewhere, i used your code, and it worked, the only diffence, i used a list<string> instead of ur object informatie
Ziee-M
4-Jun-18 8:30am
View
Hi, The problem is in the xml file not in the code (based on the error).
Somthing wrong with your main root at line 0 postion 0
Ziee-M
23-May-18 5:34am
View
What is the exception you get ?
It seems your returned id (before parse) is in wrong format, probably a special caracter in the start and/Or the end. Just remove them with a Trim() or anyother way.
Ziee-M
3-May-18 5:40am
View
Start by reading/learning sql.
You need to use "join"
https://www.w3schools.com/sql/ is a good place to start
Ziee-M
26-Apr-18 5:51am
View
This happens either when you did not rebuild, or very rarely,visual sturio is bugging. Restart Visual studio.
Ziee-M
19-Apr-18 14:51pm
View
I insist, it will not work for any website if the parameters (log, pass) are not passed in the url.
Your solution will not work for google.com or facebook for example.
Ziee-M
19-Apr-18 11:19am
View
You can't login using webrequests. And even if possible, you lose the context once you are connected, thus in your next request, you have to reconnect.
Ziee-M
19-Apr-18 10:56am
View
First, you have to get permission from the website to do. they can help you if they have for exemple an authentication service.
You did not mention what you are using (winforms, WPF, maybe web ?).
You should probably use a webbrowser, and create an automated logic to login.
webbrowser PageLoaded => fill authentication textboxes => simulate connection button.
Ziee-M
16-Apr-18 9:39am
View
This is a bad approch, passing data with query string is risky/dangerous. a better idea is post just an id, and use that id to get the data in target page from database. also, You can pass about 2000 character using get method, so you data will be corrupted if you get passet that limitation.
Ziee-M
13-Apr-18 11:06am
View
First of all, when you talk about UML, you need to precise witch diagram you are using. i guess you are talking about Class diagram here.
Getters and setters are technicaly methods, you dont want to put them but instead you put only your attributes.
Don't forget that the main objective of UML is readabilty, we need to understand your application classes with minimum effort just by reading your diagrams.
In general, you need to create many diagrams to explain your application functionality.
You would probably need to at least design your class diagram, Use Case Diagram and sequence and/or activity diagrams.
UML is not to be taken lightly, it reflect your design/conecption skills. In general, your application should have a few dozens of entity (in an end of study project). so KarstenK answer is very probably correct since you have a 100+ entity.
You should reconsider your hole conception for the project.
For the relationship part, you use the associations, so there is no class that can be created twice in the diagram.
You have to read a lot more about UML before you start.
Ziee-M
10-Apr-18 7:57am
View
Anything after the special character is removed. But, no need for further help, you are totaly right,its thier job to encode the data before sending it!
Thanks again.
Ziee-M
10-Apr-18 7:49am
View
Indeed you are right, but if i can handle it my code, that would be even better.
Ziee-M
10-Apr-18 7:43am
View
I accept this answer even thought i said in my description that this is not a valid solution.
I wanted to manage this in my reciver code not in the sender(the sender will be developped by some other dev).
Ziee-M
30-Mar-18 10:51am
View
Love this answer :D
Ziee-M
15-Feb-18 5:05am
View
Why dont you create your own list as global variable in the page and use it ?
You can save the list a viewstate instead of sessions.
Sessions are evil by the way, there is countless article about the topic.
Ziee-M
15-Feb-18 3:08am
View
First you are using ManagmentClass,
You need to add a reference to System.Management.
Right click on References in solution explorer -> Add Reference.
On the .NET tab select System.Management and click OK.
Now, just add a button and test your code.
Provide more informations after your tests.
Ziee-M
14-Feb-18 3:19am
View
Add a try catch bloc to your code, a logger to print out error message in a file (put the file in a public path), and deploy your app in the machine causing problems.
Run and check your log file. Streams are really annoying, there is so many causes for them to break such as persmissions, file is used by another app...
Ziee-M
14-Feb-18 3:09am
View
I just wanted to add, All Microsft product have been hacked/reversed (VS, SQL...). So wherever you do, if your product is targeted, it will very probably be reversed and hacked. However, there is a lot of mature consumer, it will not affect you sales as much as you think. In addition, if you do regular updates, you will very probably discourage them since they have to do all the process from scratch, witch is not an easy task! I remember there is an article written by microsoft support about this topic and how they deal with it but i could not find it.
Ziee-M
13-Feb-18 7:19am
View
Creating a simple update system is not really hard, here is an example : https://gist.github.com/sbrl/7709dfc5268e1acde6f3
This project allow you to update only your .exe, and this is probably suffisent.
You can extend & add your own logic.
For example, in your server, you add a file that holds the versions, and client app check the last version, if not the same lauch the download and replace the .exe file.
In the other hand, if you want to create somthing more complicated that download a lot of file, that will take much more time, and i suggest you to use a ready to use solution.
Ziee-M
12-Feb-18 13:19pm
View
Your welcome Mutkthahar.
Ziee-M
12-Feb-18 13:17pm
View
Thanks CPalliani :)
Ziee-M
12-Feb-18 11:27am
View
Well thats exactly how threads are supposed to function, if you had an output like the one you posted, then there would be a problem.
There are so many GREAT articles about threading on CodeProject, just search and read few of them.
Ziee-M
12-Feb-18 11:22am
View
Also are you using WPF or Winforms ?
Show us some code we will gladly help
Ziee-M
12-Feb-18 11:15am
View
You just have to fill all others 'In' parameters of you Stored procedure. In your case, you have added only the DEBT_NUM field (emp_num is one of them).
You will have somthing like this :
sqlCom.Parameters.AddWithValue("DEBT_NUM", Val(dept_num.Text))
sqlCom.Parameters.AddWithValue("someOtherField", Val(field.Text))
...
sqlCom.Parameters.AddWithValue("emp_num", Val(empNum.Text))
Hope it helps.
Ziee-M
12-Feb-18 8:23am
View
To show your message in console you can use : Console.Write();
So to post your method, Console.Write(MyMethod("MyString"));
You can also use Debug instead of Console class to show messages in your console
Ziee-M
12-Feb-18 7:50am
View
Post your code.
Ziee-M
12-Feb-18 7:38am
View
I dont know how or why this answer have been downvoted ! my 5, intresting summary of views
Ziee-M
12-Feb-18 5:45am
View
HI, you have few errors, String behind = text.substring(i-i,i) =>text.substring(i-1,i) otherwise you will get many characters instead of 1.
You have to make a trim() to your main text before you start working with it.
In addition, you have to start your analyse from index 1 not index 0 => you can add
if(i == 0)
{
continue; //ignore first loop. => now you have to add a validation to not allow user to insert an operator in the first element !
}
Otherwise you will have an error when an operator is inserted in the begining.
Finally, your work seems intressting, but you have to create methods instead of writing your code in the main, try to organise and your code will be much clearer and easier to modifiy and maintain.
Ziee-M
12-Feb-18 4:04am
View
There is absolutly no garante that Asp.net will keep the sorting when getting data from database.
You have 2 solutions here, either you are using a Datetime field for your date; and orderby (date) like Bryian suggested, or add a new field id, and auto-increment it to allow sorting.
Ziee-M
9-Feb-18 10:35am
View
Indeed, you explanation make a lot of sense in this particular case, thx for pointing it.
Ziee-M
9-Feb-18 9:30am
View
whats are you using (WPF, Winforms, asp.net)?
Ziee-M
9-Feb-18 9:23am
View
You can create your own function that Rounds using your own rule
Ziee-M
9-Feb-18 8:48am
View
I would do things a little diffrently.
-1- I create a table that holds all the possible answers, i think of this conditions as rules, that can change/update over time. setting them in a table to allow user update seems a good idea to me.
-2- Similar to OriginalGriff, i would generate a binary of 5 (00000->11111) and depending on the value, i would use my database table and get the row.
-3- The result should be only one line of code, since all your rules are in database level
Ziee-M
9-Feb-18 8:41am
View
Learned somthin new today, thx
Ziee-M
8-Feb-18 10:59am
View
https://stackoverflow.com/questions/21666412/ftp-create-folder-and-upload-files-in-c-sharp
Ziee-M
8-Feb-18 10:26am
View
You are in the right direction, keep going.
Fews corrections : to set a grid data, you need to use its DataSource propertie, and call databound after that.
DataGridView.DataSource = SweetsInventoryDataSet;
DataGridView.DataBind();
Ziee-M
8-Feb-18 8:19am
View
Can you link an image ? Winform is old, but it certainly is relaible. application such Visual studio, Sql server, Outlook... are developped using winforms and yet no DPI problems
Ziee-M
8-Feb-18 7:54am
View
Can you please mark the solution as an answer.
Ziee-M
8-Feb-18 7:38am
View
sharmarun solution is if i may say, is the standard way to get your row index. There are 2 informations not clear thought. This code goes in the OnSelectedIndexChanged event. And you have to add the event in the markup : <asp:GridView ID="GridView" Runat="server" OnSelectedIndexChanged="yourSelectedIndexChangeEventName" AutoPostBack="True"/>
AutoPostBack must be set to true, to allow a post back when the selected row is changed.
Ziee-M
8-Feb-18 5:10am
View
I think you just add a trigger that raise an exception in Database level when no tickets are left. and you have to manage concurency in a hight transaction environement like this one.
Ziee-M
8-Feb-18 4:57am
View
I dont think this is a practical solution, many other users will be blocked while the first one is buying. In addition, the Booking process can take several minutes.
Ziee-M
8-Feb-18 4:36am
View
This is actually a concurrency situation. Concurrency occur when more then one transaction tries to update the same row/data.
An exception will be raised if you fall in this case and you have to handle that exception to resolve the situtation.
I cant Give you more details because it totaly depend on the tools you use to access your database (EnityFrame, ADO.net...)
Each one of these handle the Concurrency diffrently.
Just a few searchs with concurrency keyword, and you will find a lot of answers.
Ziee-M
5-Feb-18 8:03am
View
This is a Unity3D javascript code, give as much informations for users to help you.
You can use the unity3d scripting refrence to translate all this to C#, it will take you fews minutes. just search for the method name (Distance) and check the code written for it in both javascript and C#.
The API is really intresting, always go back to it for examples:
https://docs.unity3d.com/ScriptReference/Vector3.Distance.html
Ziee-M
2-Feb-18 10:49am
View
https://www.dotnetperls.com/streamreader
Ziee-M
2-Feb-18 7:08am
View
In the asp:gridview tag add the OnSelectedIndexChanged= "GridView1_SelectedIndexChanging" to subscrive to the event.
<asp:GridView ID="GridView1" runat="server" AllowPaging="True" AutoGenerateColumns="False" CellPadding="10"
CellSpacing="0" OnRowDataBound="GridView1_RowDataBound" OnSelectedIndexChanged= "GridView1_SelectedIndexChanging"/>
Remove your RowDatabound code, and add your logic in the OnSelectedIndexChanged event
Ziee-M
2-Feb-18 4:56am
View
Deleted
You can't send an sms using webclient ! you have to use a 3rd party API, and, you have to pay for each sms :). you will get free tests sms for dev purpose
Ziee-M
2-Feb-18 4:03am
View
In calculation, you have to set the row index : grdlist.Rows[RowIndex].FindControl("txt_BCICU")
Ziee-M
1-Feb-18 11:20am
View
In Asp.net, the Id you mention in your code is not the same when the application is running, to get your elements, you need to use : "<%= yourControlId.ClientID %>" instead of "yourControlId" in your javascript/Jquery.
Still, you have to provide much more informations for us to help you.
Ziee-M
1-Feb-18 11:00am
View
Hi sudhakarthikeyan, you are using the wrong events to achive your goal.
Here is how you should do it :
1-Page load event : Bind your GridView1
2-GridView1SelectedIndexChange event:
You get the information you need from the Grid1, and use it to bind Grid2.
Thats it.
You should however study a little more the events flow/order for Asp.net to get a clearer idea of Asp.net life cycle.
Ziee-M
23-Jan-18 10:36am
View
No need for a design pattern, just use a class for search criteria, you can extend that class properties later : Method(SearchCriteria searchCriteria)
Ziee-M
10-Apr-15 12:35pm
View
If possible, can you explain the need to move from WPF to Windows froms?
Ziee-M
20-Oct-14 14:32pm
View
I tested the AutoResetEvent on the main thread, and an exception occurs when debuging, I am not sure but it seems the AutoResetEvent.WaitOne() dosen't work in the main thread.
Thank you for your help.
Ps: I removed my answer.
Ziee-M
20-Oct-14 13:01pm
View
When we use Thread.Sleep() vs WaitOne() on the main Thread, the Sleep() statement blocs the UI, in the other hand, the main thread dosen't bloc when we use the WaitOne() and continue rendring the UI. Thats what i meant.
While my solution may not be usable in this case, The answer i gave is not wrong, since it answer how to synchronazation thread.
Waiting for your answer. i already learned a lot from your answers, i guess i am about to learn somthing new.
Ziee-M
20-Oct-14 12:29pm
View
Hi SA,
I am pretty sure from a previous experience that the AutoResetEvent dosen't cause the UI to block. I think the wait and the sleep state are diffrent states.
I will be doing some tests to confirm.
Ziee-M
20-Oct-14 11:23am
View
I totaly agree, i used Application.DoEvents in long running process and it ends by a crash : unhandled exception.
Ziee-M
20-Oct-14 11:09am
View
Hi, load the new data in a list when you click in the first datagrid, then bind the list to the second dataGrid.
//Click event
MyList = GetSelectedObjectInformation(); //this method returns the data of the selected object
DataGridView2 = MyList; be sure to bind in case your GridView is not binded to the the type of your list.
Ziee-M
20-Oct-14 11:04am
View
HI, try using ObservableCollection instead of list. normaly the view should update automatically once youuse this type instead of old list.
Ziee-M
24-Sep-14 4:34am
View
hi, you can use streamReader and streamWriter to read or write to/from a file.
then, create your instances and bind them to your gridview.
using file is not recommend thought, you may use xml or jason to save data in a file and do crud operations much easier.
Ziee-M
11-Aug-14 7:48am
View
I just watched the code and the approch is wrong ! you are instanciating 150 thread ! thats useless (totally wrong !). instead, create a limited number of thread and make them do the job.
Why? because each thread can be executed by a processor, in your PC you don't have hundred of processor (8 in the best scenario for a Personl computer)
I recommend you to read a little about threads and their life cycle, computer architecture...
Ziee-M
11-Aug-14 7:37am
View
you can't increase a thread speed, but you can increase priority althought its not recommended.
the only way to increase speed is to optimise your code or use a better Computer (processor).
Ziee-M
11-Aug-14 7:32am
View
Hi, i am a little confused about this case, since the Alert_Window is created within the thread, using delegate shoulden't be a must.
Here is how i do it using anonymous method, try it just to be sure if the issue is related to the item appertencance.
Alert_Window aw = new Alert_Window();
aw.Invoke((MethodInvoker)delegate
{
aw.Show();
});
if this don't work, then your issue has nothing to do with item appartencance.
Waiting for your response !
Ziee-M
5-Aug-14 9:05am
View
mail.to.Add("x@x.com") you have to precise the reciver : if you executed that code it want work since the email is not valid.
smtp.Credential ("your email","your password"): you have to put in here the email that will send the message + the password.
Ziee-M
31-Jul-14 9:20am
View
Hi, i think you have an issue in your model since you have student and stuff class in both DataLayer and buisness layer !
I think your real issue is how to do it best rather then how.
First, there is no "best solution" here ! it really depends on your needs. using an ORM or classic sql also have an impact on your global architecture.
You may read this article, althought its not exactly your need because the writer is using dataTable to pase Data beetwen layers, but, you will learn a lot and it will help you make your choice.
http://www.codeproject.com/Articles/493389/Four-ways-of-passing-data-between-layers
Ziee-M
31-Jul-14 9:04am
View
I personnelly encarage you to use entity-FrameWork, a very powerful yet easy to use ORM that allows you to type your code first, start from a database or a diagram. plus there is a lot of documetation.
Now days, ORM are a must.
Ziee-M
31-Jul-14 7:44am
View
try removing using (for tests reasons only), mabe the object is destroyed before actualy being used.
Ziee-M
11-Jun-14 4:43am
View
nice article Peter, it dosen't talk in depth about AM117 needs, but its a good start. my 5.
Ziee-M
27-May-14 9:18am
View
Start by posting your code or anything that can help, no one will figure your issue with that much informations.
Ziee-M
27-May-14 9:13am
View
I support your answer, Unity3D have many advantages, A very big community, excelent tutorial and the most valuable is : Unity is easy to learn compared to other game engine. within one month you will grasp the main features and strat developping your first mini game.
Another advantage, Unity is free for almost all the platform, you are forced to buy licences only once you start making money (about 10 000$).
You will have a lot of fun, hope i can find the time to get back into unity development too.
Ziee-M
26-May-14 12:47pm
View
Hi, using C# you can show a tooltip like this.
ToolTip tt = new ToolTip();
tt.Show();
I guess there is not a big diffrence with C++
Ziee-M
26-May-14 12:35pm
View
my 5, i never thought about it, now its saved deeep in my brain! (talking about the info in the bottom)
Ziee-M
26-May-14 10:07am
View
Actually i remeber i made a LOT of resarches in the subject and i diden't find the answer easly. the issue is that you need good examples to understand the diffrence. so i belive you have to try searching for a video when you don't get it with an article.
Try one of my best c# blog:
http://csharp-video-tutorials.blogspot.com/2012/06/part-33-c-tutorial-difference-between.html
Ziee-M
23-May-14 12:39pm
View
Hi, you can use "AutoResetEvent" to achive your goal, using Wait() and notify().
Ziee-M
23-May-14 4:42am
View
Its not challenging only for you, its really challenging, i will do some more resarch.
Are you able to select a list of all the userControll but can't identify those who are exactly your target? this information may help
Ziee-M
22-May-14 7:51am
View
Hi, upvoted the question since its really intressting / original.
I am pretty sure its possible since the Property window of visual studio lists all the control present in the current form.
if you can manage to get all the control, then check the type of each one of them, then you will reach your goal.
Ziee-M
22-May-14 6:40am
View
Hi, what do you mean by validate? maybe you are refering to checking if the string is in a url format?
Ziee-M
22-May-14 5:19am
View
Hi, putting a lot of information is not effective, try to summarize your question, put only the details you juge usefull for other users to understand your issue.
Try to explain your aim, and your issues along the way for better readability.
Ziee-M
22-May-14 5:00am
View
Permisson issue when accecing databases may be the issue.
Ziee-M
22-May-14 4:43am
View
hi, i am not a android nor iOS developper, but i guess it have somthing to do with file extension. is your Android, iOS have a programme that allows you to read excel file?
Whats happens when you try to export a file in those OS? error, exception...
Ziee-M
22-May-14 4:37am
View
Hi, you have posted the question twice, better delete this one, and check your answers in the other
Ziee-M
21-May-14 12:42pm
View
use convert or parse to be sure the type is int.
Convert.toInt16(singleCellRecords[0])
Ziee-M
21-May-14 11:40am
View
I don't see why you are linking your error to entity framwork, generally if one operations works the others should work too! debug step by step and check all you variables, instances and lists stored data until you reach the null reference.
Ziee-M
20-May-14 12:57pm
View
Hi, i don't think there is any EASY/SIMPLE optimazation (talking about the loops). In the other hand, if the CreateEmail sends emails,then yes you can optimise your solution.
Ziee-M
20-May-14 12:15pm
View
hi, i don't think its possible for any app without using an intermediare such as a database to save the app state.
I will be waiting for an answer,maybe someone will give an intressting solution.
Ziee-M
20-May-14 9:43am
View
I don't see the need to read app.config. app.config contain connection string to databases and other configuration stuff.
Help us understand your issue a little better.
You need to develope an app that connects to diffrent websites, retrive html code, and do some stuff?
Start by explaining the need, then how you see it done using code.
Thanks.
Ziee-M
20-May-14 9:23am
View
hi, first you have to set the childform WindowState to default (you may find it in the properties of the form).<br>
<br>
Then, when instanciating a new child,<br>
<br>
child.Dock = DockStyle.Fill;<br>
<br>
*Optional:<br>
you have to disable the MaxemizeBox to false (child properties) so the user can't force the window to its max.<br>
<br>
Finally, in case the child donn't automatically resize when the parent container change size, you have to write some code in the form size changed event.<br>
<br>
I 'am not 100% sure it will work for you because i am useing a ribbon (Graphic Dll like Microsoft office, you may check it in code project articles, pretty beautiful for MDI system).<br>
Hope it helps
Link for the ribbon MDI System : http://www.codeproject.com/Articles/364272/Easily-Add-a-Ribbon-into-a-WinForms-Application-Cs
PS: using this ribbon will force you to install .Net FrameWork 4.0 full on client machine instead of .NetFrameWork 4.0 client profile. for windows 8, .NetFrameWork 4.0 full is installed by default, not the case for Windows 7.
Ziee-M
19-May-14 9:29am
View
Hi, first when creating installer you will have issues later if you use sql. you can't export sql dlls easly. a better choice is to use a portable database such as sql compact, MySql... that way you may install your app in any computer.
You may check : http://erikej.blogspot.com/
You will find anything about sql compact if it suit your needs.
Ziee-M
19-May-14 8:59am
View
it seems you are not doing enought effort! you are not supposed to copy paste a code espacially when you are not puting some of yours into the questions! try work harder, put menangful comments, not a "object refrence not set to an instance of an object".
Ziee-M
19-May-14 8:02am
View
I don't think it is possible, since EF have to generate entitys (not possible on runtime).
i will be waiting for a response too :), it may be intressting.
Ziee-M
19-May-14 7:50am
View
The solution diden't work either, i sended back the file from the Computer causing the issue, and i opened it in my PC, the file is shown correctly.
If anyone have another idea, that would helps, thanks
Ziee-M
19-May-14 7:15am
View
Hello Krish, sorry i diden't open codeproject for a while, The exeption you r facing means the form is still not created or the controll is alerady diposed (just like i said in my final line of the solution).
Now, the order of execution of methods is important.
You have to be sure all the contolles in the form have been created before using delegates to acces a controle. so starting from Page_Load method, you should be okay.
Also, try doing somting like writing in a label using a delagte to understand the idea and test.
By the way i just noticed, but :
DataGridView1.Rows [ count - 1].Cells [ 1 ].Value = Value; // you have to add -1 to the count since the start pos is 0
Waiting for your response.
Ziee-M
13-May-14 12:35pm
View
I am sure about the data saved in the db in UTF8.
According to many threads, some pepole had this issue, and its related to "ByteOrderMarking"(BOM) not created issue. i will try the solution founded for now :
using (StreamWriter sWriter = new StreamWriter(stream, new UTF8Encoding(true)))
instead of
using (StreamWriter sWriter = new StreamWriter(stream, Encoding.UTF8) )
Ziee-M
13-May-14 11:57am
View
Hi, the data i get from the database are In UTF8 Format, when i export the data to a file using streamWriter while specifing the encoding to UTF8, i get the issue in some computers. after some resarh, the issue shouldn't exsist in the first place, althought i am not sure!
Ziee-M
12-May-14 12:57pm
View
Hello! there is an excellent tutorial on youtube to achive your goal. i followed the tutorial and it helped me a lot.
http://www.youtube.com/watch?v=Oa7vMrGKifo&list=PL3iOx6lykrwqc_KuJWIU3yAyTP2C7h_xE
I am not convinced with The idea of "Prasad" of saving the version in a database, you just have to use your assambly version, and upgrade the version each time you upgrade the application.
Ziee-M
12-May-14 12:42pm
View
hi your question is not clear enought, you do have intelesence when working with html in visual studio!
try explaining a little more.
Ziee-M
12-May-14 12:39pm
View
Hi there is no scenario where you need to use entity framework code first, its a question of a preference. you may use db first approch or model first approch to reach your goal.
In the other hand, many developper thinks code first approch is the best one since you will have a better management of your entitys. (or probably beacuse they used java where no model first approch exsist).
Ziee-M
29-Apr-14 11:49am
View
Hi, i am using list.Clear() to free memory, is it the correct way? because the app "private bytes" keep increasing while "Bytes in all heaps" are stable.
if List.Clear() works correctly, then i think i have a memory leak somewhere.
I am getting out of the main question's topic here.
Ziee-M
29-Apr-14 5:38am
View
Hi CPallini, i will do my tests and monitor the memory, i will feedback soon.
Thanks for your help.
Ziee-M
29-Apr-14 5:27am
View
Hi OriginaGriff, I am binding the list to a grid, kind of an animation to make the user feel the application is still running since the process is very long, if i limit the list to 1000, i guess it will do the job? Now it will take me some time to change the code, but i will let the solution as is until i finish my tests, i will be doing other memory monitoring, and i will feedback.
If you may link me to an article talking about your last paragraph, that would help me a lot.
Thanks for the fast and accurate response.
Ziee-M
25-Feb-14 3:35am
View
There are a lot of cases for the code to return (401) Unauthorized in the server while it works in local.
enable SSl, try changing the default Port(587 or 25). and finally you have to precisze the Host.
Keep doing tests.
Ziee-M
21-Feb-14 4:46am
View
circular dependencies mean First Project have a reference to Second Project and vis versa, its not allowd to do so, You have to choose a unique sense. 1 reference 2 or 2 ref 1 but not both eference each other
Ziee-M
21-Feb-14 4:16am
View
Hi,So you want the update to occur automatically once the user change the value of a textbox?
Ziee-M
20-Feb-14 5:48am
View
sorry, the link works now, the article is about winforms, there are better article out there but i couldent find them, there are other techniques not described in there so do some resarch to find them out.
Ziee-M
20-Feb-14 3:37am
View
I tryed changing my current framework from 4.0 ,3.0 then to 2.0. i always have this message:
What's My setup?
What browser am I using?
You appear to be using Internet Explorer 7.0.
Ziee-M
20-Feb-14 3:27am
View
Oops, i'am sorry i did check again, actually webbrowser is based on IE.
I have created a new project with WebBrowser Component in it,
I then navigated to http://thismachine.info/.
I got all the info of the webbrowser i currently used.
Try it yourself
Ziee-M
20-Feb-14 3:11am
View
actually, webbrowser isen't based in Internet explorer.
Ziee-M
20-Feb-14 3:05am
View
Hi, probably some of your tables don't have primary key! ADO.net require a primary key in each table
Ziee-M
17-Feb-14 12:38pm
View
You should put your code in the load in the PostBack: like this
if (page.ispostback)
{
....
}
or you can get rid of the if, it should work
Ziee-M
17-Feb-14 12:35pm
View
you can't show 2 table in the same grid. however, you can parse your two table elements objects to same object type, and then put all in a unique datagrid.
Ziee-M
17-Feb-14 12:31pm
View
If there is no postback then the event won't fire! because its a server control.
You can make a dropdown using html or jquery, and get your values using javascript or jquery.
Ziee-M
17-Feb-14 6:51am
View
I am not 100% sure, but there is an incompatibility issue with Linq and DateTime.
Try to select a list, then filter the data using foreacah instead of the Where clause, i think it will solve tour problem.
Ziee-M
17-Feb-14 6:06am
View
I don't understand very well your issue, could you explain more in depth? i worked a lot with webbrowser, i think i may help you a little more
Ziee-M
17-Feb-14 5:54am
View
Actually you are getting the source code of the page using the HttpWebRequest, you can use some scrapting(play with the source code using strings to get the content of Gridview). however, i don't think its the best solution.
Ziee-M
17-Feb-14 5:49am
View
I never used Silverlight, but i guess if you can't use Post instead of get, the remaining solution is to use WCF services.
Ziee-M
12-Feb-14 10:29am
View
exactly, microsoft is getting rid of MDI system. personnaly i find MDI system useful while many other developper don't.
Ziee-M
12-Feb-14 8:47am
View
hi, some code may help, i diden't understand what master and child you are talking about! are you refering to MDI system parent and child?
Ziee-M
12-Feb-14 7:31am
View
an additional column in the database can help you to know if the row is new or not, then change the row color accordingly.
Ziee-M
11-Feb-14 11:59am
View
you have to write == instead of = in the where clause!
Ziee-M
11-Feb-14 11:58am
View
sorry for the error, you should write where cont.ContactID == cboContactList.SelectedIndex
== instead of =
Ziee-M
11-Feb-14 10:52am
View
hi, you are selecting your first element in the list : var contact = context.Contacts.First();
try using link to select the 4th record.
var contact = (from cont in context.Contcts
WHere cont.Id = 4 //I don't know your Identifier, you have to use yours
select cont).SingleOrDefault();
Ziee-M
23-Jan-14 9:07am
View
It may be a privilége/permission issue, happend for me before!
Ziee-M
23-Jan-14 8:59am
View
Hi, how are you going to give the app to your client? If you are going to create an installer, then the client won't notice the database(you can save it in a diffrent location then the app setup directory)!
Ziee-M
9-Jan-14 10:50am
View
actually the deployed version in release mode don't detect the error,
in deubg mode, deployed version work fine!
i will try this approch too hope it works
Ziee-M
10-Dec-13 5:41am
View
you can probably achive your goal using DataGrid, but you have to create custom methods.
DataGrid allow multiple row selection, cell selection... so i think its much better then using weBrowser.
Ziee-M
10-Dec-13 4:59am
View
By the way, why are you using WebBrowser to get Data from a file? you can use streamsto read and put the data in a richtextBox, a datagrid...
Ziee-M
10-Dec-13 4:55am
View
Hi raj,
try doing the process manually,
add a button that gets the browser.DocumentText(). run your application and wait until the webBrowser loads the page successfully, then press the button and check if your value is always null
Ziee-M
10-Dec-13 3:36am
View
Also try to remove Application.DoEvents(); from there, its used in the wrong place. in general we use it to wait until the webpage is loaded successfully
while (webBrowser1.ReadyState != WebBrowserReadyState.Complete)
{
Application.DoEvents();
}
again, its not a good idea to use it in long running loop.
in my case unhandeled errors started occuring after 5000 loop, so i switched to threads.
Ziee-M
10-Dec-13 3:21am
View
hi, i dont think its a good idea to use Application.DoEvents(). if you have a long running loop, your application will crash sooner or later, you will have to use threads and synchornisation later.
From my expirence working with webbrowser, the WebBrowser.document is not very stable, i stopped working with it, but it should work fine in your case, try using DocumentText, you get a string variable. you can use methods like String.Substring, Replace, remove (Strings methods) to get your data.
If your Html code is clean, you will have no problem. althought i am not sure if this is the best solutions.
Don't hesitate to ask more questions.
Ziee-M
9-Dec-13 12:17pm
View
Hi, i don't think its is possible, but you can do cascading, it means when you select a column or a row, you will fill another datagridView based on the data selected inthe first datagrid.
Ziee-M
9-Dec-13 7:34am
View
Hi, post some code so we can help you.
Ziee-M
9-Dec-13 7:28am
View
you have to install the Framework 4.0 in the target machine, you may select the Framework.4.0
as required components in the setup properties of the project.
Ziee-M
5-Dec-13 7:18am
View
i tried VC++2010 dident work! i will try the NSIS, hope it fixes my issue.
Ziee-M
3-Dec-13 9:02am
View
http://www.codeproject.com/Articles/364272/Easily-Add-a-Ribbon-into-a-WinForms-Application-Cs
i'am using it, it works fine and you can customize theme, hope it helps
Ziee-M
21-Nov-13 3:15am
View
i think you can use EntityFramework Code first approch! Implemented in the .net Framework 4.1
Ziee-M
20-Nov-13 8:53am
View
Hi, there is the old Micorosft exam System MCTS, there is one for the ASP.net framework 4.0, you should search the PDF in the web. but about one year ago, microsoft changed all its certifications. here is a link that describes the new Exams system:
https://www.google.tn/url?sa=t&rct=j&q=&esrc=s&source=web&cd=1&cad=rja&ved=0CC0QFjAA&url=http%3A%2F%2Fdownload.microsoft.com%2Fdownload%2FB%2F2%2F0%2FB20EE9DE-1D56-4213-B7B6-AFBAC402BDE1%2FIT%2520Academy%2520-CertRoadmap.pdf&ei=eb6MUuP5IsK30QXbwYDIBw&usg=AFQjCNE8qfA2EyM4m33k953TE9u59dn7sw&sig2=6XwW-whbbxB3kYq6GkNDjA
Ziee-M
19-Nov-13 11:44am
View
You have to use your class name to access static fields:
YourClassName.ContactDetailFax.Add(ContactDetailFax);
Ziee-M
18-Nov-13 3:12am
View
Hi Ese, it seems you are using SqlConnection(i am not sure), in that case your connection string is set pragramatically, so you dont have to put it in the app.config.
For deploying in diffrent servers, you have to change the connection string and redeploy, since you connectionstring holds the server credantials and the server name...
i suggest you to start the deployment process, you will very soon notice that its not hard.
the first step is to change the connection string to access the server dataBase from your application(installed in a target PC).
Ziee-M
15-Nov-13 7:41am
View
hi arun, i don't think it is possible to change a thread execution state like that! you have to use synchronsation
Ziee-M
7-Nov-13 10:22am
View
Hi --SA
1/passing value is possible from parent to child, no problem. but from child to parent, i think only your Interface solution should work.
2/Now for MDI system, actually i am using it, i don't find any advantage, but i cant go back after going this far in my app. (the advantage is probably the UI, it is a little better)
Ziee-M
7-Nov-13 3:33am
View
actually he is using Mdi system, i' am not sure if that technique works fine to pass child data to parent Sergey !
Ziee-M
6-Nov-13 2:01am
View
Share your code or some of it, otherwise no one can help you!
Ziee-M
6-Nov-13 1:42am
View
When closing your form, the application should handle closing process in the task Manager, if it dosent, then you have some ressources used that blocks the application from terminating.
You should dispose all disposable ressources and terminates your application threads in the form closing event!
Ziee-M
6-Nov-13 1:20am
View
nope, :D but it dosent matter, it may be useful for someone else!
Ziee-M
5-Nov-13 9:49am
View
not really related with the question, but i stronly recomand using an ORM such as EntityFrameWork, totaly worth it. and you will no longer use datasets and datatables !
Ziee-M
5-Nov-13 8:04am
View
i will make some tests. i will be changing the Data layer and check if changing the .exe will do the job or not!
Ziee-M
5-Nov-13 8:00am
View
i think its poor for an answer!
Ziee-M
31-Oct-13 12:50pm
View
Hi Wamuti, regenerate your entitys in worst case scenario, delete our model and regenerate it agin from your database, i dont have any additional idea for now!
Ziee-M
30-Oct-13 13:27pm
View
Hi Dave, so in other word, the lock is totaly useless no? since main thread can change the variable value while thread1 only reads it?
Ziee-M
30-Oct-13 12:07pm
View
:) thx again, sorry i cant explain since this is the 6th months of work in this project, and i have more then 6000 line of code, so i dont know from where i will start explaining.
Ziee-M
30-Oct-13 11:45am
View
thx, i guess i have somthing wrong in another part of the codes. but i'am very intresetd to know why you think there is somthing suspicious in the code(contructive critique are always welcome).
Ziee-M
30-Oct-13 3:38am
View
i am using EntityFramework and ADO.net since ages but i ve never faced this, however, you can add a partial class exam , and add your new constructor there, and you will never have to use that method again.
Ziee-M
30-Oct-13 3:31am
View
Deleted
if i remeber right, .xls cant support more than 4 MB, change extension to .CSV, this format is pretty the same(by default opened by Excel) but dont have a size limit
Hope it helps
Ziee-M
30-Oct-13 3:08am
View
i dont think it is possible to bind diffrent class to the same grid, But you can inherit both of your classes from a parent class, and declare your both of them as parent class, and finally affect both of them to same Grid.
Son1 son1 = new Parent();
Son2 son2 = new Parent();
and datagrid will hold Parent object.
hope it helps
Ziee-M
29-Oct-13 9:22am
View
you can use this code to wait for the webbrowser to complete loading the page
while(webbrowser.ReadyState != WebBrowserReadyState.Complete)
{
Application.DoEvents();
}
this is a temporary solution, it will break if you have a long running loop.
you will have to use threads later and ensure synchronisation.
Ps: after the web page is charged, you have to get your tags again since the html code will be changed!
Ziee-M
29-Oct-13 3:38am
View
after invoking pElement.InvokeMember("click";), the web page in the webbrowser need some time to refresh! webbrowser is an async control, you have to wait until the change is completed
Ziee-M
9-Oct-13 10:34am
View
Better work with ORM such us Entity Framework or Linq To Sql. that way you can find the error easily if located in a query
Show More