Dave, Thank you for your input and response. I am fortunate that someone with your depth of knowledge and credentials took the time to bring me up to date. Since my use is for an application and not a webpage, HTML5 is and never was a solution for me. I understand the legalities and I thank you for bringing it to my attention, but I don't think that there are less than 100 videos posted ON YouTube that explain how to use the Shock-wave Viewer in a C# form to view the content of videos posted on You Tube. Like most things today, and as You Tube already knows (or has found out), as quick as they make a change there will be some one with a new key for the lock. It is not possible to post something in the public domain without having someone else contrive a way to get around it. That said, I prefer to do it right and I will simply have to find (or create) a service and/or system that will let me continue to have videos viewed privately from within proprietary software. Perhaps I will change the videos to (mp4) and host them on my own server. Then I can use the Microsoft Media player that already has libraries in Visual Studio. In my case, the most disturbing thing was the timing. Thank You Again. I would like to be able to call on you for advice and perhaps even do some work for me if you are interested. Best Regards, Pat.
PDTUM
Posts
-
Shockwave Simply Stopped (Maybe Windows 10 update issue) -
Shockwave Simply Stopped (Maybe Windows 10 update issue)Hello, I wrote a program in C# using VS2010 that has a media page that pulls videos from You Tube. It worked perfectly until this morning. Today, all I get is a blank screen. Even if I get straight to the basics and hard code a movie file into the properties menu, all I get is a blank screen. The only thing that I can see that might have happened is that the program did the newest Windows update (Windows 10) last night automatically. To check this theory, I had a previous version of the application on my laptop that also runs Windows 10 .... so I checked it out and my older version of the same app running on the not updated Windows computer works perfectly. It seems that Windows 10 has destroyed something in the Flash support, maybe the Flash.ocx file? I really don't know. I was supposed to launch this application at the end of this week, so this is a major issue now. I don't know how to repair this. Appreciate any help. Thank You, Pat.
-
Transfer data from Dataset to Report ViewerThanks Gerry. I removed the space. No difference. I put a in complete long hand path id. No Difference. No Errors. Datagrid is fully populated. I tried alternating between dataset and dataTable. Nothing. No errors. Just sits there blank. I almost feel angry that there is no easy way to take the data that is just sitting there in the grid and moving it into the report. This is do-able with Excel. But I have chosen not to do that in this case. I did not want to use Crystal Reports (never liked them), and now I am not sure if that will work either, but I certainly need a solution. I regularly use Code Project (since Y2K days), but this may be the first time in over 10 years that I cannot neither get nor figure out a solution. I greatly appreciate your time and expertise. I'll keep looking. Thank You. Pat
-
Transfer data from Dataset to Report ViewerThank you Gerry. I did both. No Difference. I appreciate your response. Any followup and I'll be looking. I'm a few days into this problem and I have gone nowhere. Rare for me and a total waste of my time. Appreciate your advice. Pat
-
Transfer data from Dataset to Report ViewerGentleman, And so it goes... I created the following code to accept data from my dataset on another page and propagate it in a report viewer.
private void DisplayReport_Load(object sender, EventArgs e)
{
dataGridViewReport.DataSource = null;
DataTable dt = ds.Tables[0];
dataGridViewReport.DataSource = ds.Tables[0].DefaultView;this.reportViewer1.Reset(); this.reportViewer1.LocalReport.ReportPath = Application.StartupPath + @" \\Report1.rdlc"; ReportDataSource rds = new ReportDataSource("Precheck Report", dt); reportViewer1.LocalReport.DataSources.Clear(); reportViewer1.LocalReport.DataSources.Add(rds); reportViewer1.RefreshReport(); }
When the page loads, this page accepts the dataset value from the constructor and uses it in the code above. This has been an ordeal up until now, but I think this might be close. I think the problem might be that the report file cannot be found. Now, when I created the report file (Report1.rdlc), it appears with the other form files. What I thought I read is that this would then be located, on RUNTIME, in the /bin OR /release folder, but it does not appear to be there, nor can I copy it to that location. I cannot find where the actual path is, only the path while it is not running. So ... first, I am not sure if I have the code correct to create the report but it is no longer throwing any errors. The view display simply says that it cannot locate this file. And second, just where should I be pointing at so that this code (or any code) has the correct path to the file so the report can be created. Thank You!
-
Plug in for Gecko Browser Window to view a PDF?Gentleman: I would like to raise a browser window as a way to view a PDF. Right now, the application raises the window and propogates an internet address perfectly, however it does not launch a default PDF application as a way to view a file, and if I force it manually (which would defeat the purpose of the application) it will appear in an external window. The window must be internal to the application. I have made it work with some aftermarket solutions such as Apitron but their solutions are rather pricy, so I thought the best way to handle it would be to use a browser in an application window that could be stacked on other windows. If I could use a plug in to run a PDF viewer of any kind inside that window, it would serve as an acceptable solution. SO ... how do I add a plugin to Gecko so that it will run a PDF file when the page is loaded? Thank you in advance...Pat
-
Update Database for C# applicationThank you for your thoughts Nicholas. Truthfully, I am confused due to my lack of experience with "big" databases. Big is a relative term. What is Big? Perhaps some numbers might help. Lets say that there is a table called 'Orders' and it has 30 columns. Now lets say that it creates about 10 new rows every day per client. It must be able to retrieve 2 years worth of data in this table before it can be purged, or about 500 days. So that would be 5000 rows per client. Now, if it was a single database being shared by potentially 1000 users, that would make 5 million rows with 30 columns each for this table. Assuming that about 8 of the tables have this same amount of data, and the others are much smaller, the question is "is this big"? The problem is that I do not know. It seems big to me, but then again, I never understood how a major search engine can look through billions of entries in a matter of seconds either. To your statement that separate databases decrease performance, I would disagree with that in its entirety. On the other hand, I totally agree that Administration, which is what triggered the request for information in the first place, is definitely the issue of concern for me with individual databases. I suppose I could write an 'update' script to modify the database each time I update the program (a possible solution). I am at the point that I must go one way or the other. You raise some excellent points. Looking it over, perhaps a Hybrid choice is possible. Nothing says I cannot have 10 databases instead of 1000 which would limit the total users to 100 and decrease the data storage by 90 percent. Perhaps? The question is...Is that Enough? At how many users do I stop and make another database...10, 50, 100? I will keep researching and considering expertise from developers like yourself, for which I am grateful. If you have any followup thoughts, or can shed some light for me on the numbers game, please feel free to write me either here or privately. I appreciate your time and expertise. Thank you again. Best Regards, Pat
-
Update Database for C# applicationThank you David. I appreciate your suggestion and I have found a little better link (solution) than Microsoft's to describe the Alter command's use. I will practice with it on a sample database and then include that script as part of the program update. If you get this and you specifically know of some better comparative software for database modification, please let me know, and THANKS again.... ps; sorry about all the questions. I am methodical and just want to get it right the first time if I can. I appreciate your response! Pat
-
Update Database for C# applicationSo...it seemed like a good idea at the time. I have a C# application that is distributed among multiple users (about a dozen). I set each user up with their own database (MS SQL 2005) so there is no interaction between users and it works great. Now, I am making a change to the program which requires a change to the database. In the past, with just a few users, I simply went into each database and altered the tables one at a time ... takes a few minutes for each one. But as the number of users grow and I keep adding features to the application more frequently ... well, you can see where this is going. My question is; what type of command can I use to alter the databases (a script of some kind?) to add or remove columns from tables, add tables, etc. to make it so that I can alter multiple identical database structures at the same time while maintaining the data in them. Although I have been making databases for my applications for about 15 years, this is an area that I have never had to deal with; something I would assume would normally be the job of a dedicated DBA. If applications end up being sold on a larger scale (and it is heading that way), then I would hire such a person immediately. I considered having everyone in a single large database at the start and simply use proper queries to pull the data, but I decided that the sheer size and loss of performance would not make it as nice as it is, especially if I were to end up with several hundred users. There are about 30 tables in the database. I never really understood the limits and capabilities of these databases; only to say I don't really trust them to do the job when they get too large(not very scientific; more of a gut feeling). Am I way underestimating the ability of the database? Until then, can you give me a lead in on how to do this? I love it here at Code Project and I Thank You for your time....Pat
-
Pass Info from Desktop App to WebpageGood Morning, I have a C# desktop application in VS10. I want to able to use an online search engine to retrieve information. I use the following code to call a webpage from the desktop:
string getPage = "http://www.theWebpage.com/";
System.Diagnostics.Process.Start(getPage);Once I am on that page, I want to pass the information from a textbox on my application directly to a search box on the webpage. Now, I can obviously do this by cutting and pasting the info into the webpage, but what I was wondering if I can have it load the info into the search box automatically when the page loads. The closest I can come now is to automatically copy the info from the textbox using the copy function, but that still requires to user to click and paste. I know how to do this from webpage to webpage but I have never done it from a desk application before. Can it be done? Thank You...Pat
-
Return String from a CheckListBox ControlYES YES YES YES YES YES YES YES ........... Thank You Eddy...VERY Much...I'd be too embarrassed to tell you how much time I spent of this yesterday. The following is the actual code that I extracted from your sample to resolve this:
foreach (var element in checkedListBoxServices.CheckedItems) { textBox1.Text += ((string)element) + Environment.NewLine; }
It seems that your use of the new context (var) replacing my use of string and then casting for the result later with (string) makes a big difference ... I need to look at this again to really understand it, but I know that I can thanks to you. Much appreciation and thanks...Best Regards, Pat ps: after searching for this yesterday, and finding 'solutions' that were a page long and STILL did not work, I am sure that hundreds of others will be wanting the thank you as well for a concise usable solution... :) Pat
-
Return String from a CheckListBox ControlSeems simple enough, and I have looked hard and found many code sources (because some here might say this has been asked and answered), but none of them seem to work (I am showing some below...there are more). Teh primary error seems to be the following error (unable to cast object of type 'system.data.datarowview' to type 'system.string ) or something similar to this. It seems like I solved this problem a while ago by giving up on the check list box and using a list view box with the show checkbox property added, but I cannot find my original code. So, in a nutshell....I want to simply return the string values for the checked items in the control and add them to an array or arraylist (either will do). BTW...the checklistbox control was filled using an SQL query (shown also), in case that makes a difference. You guys have almost always come up with a solution of sorts, and I thank you again in advance for your great assistance and talent...Regards, Pat //Query Code
//Create an Arraylist to hold the values
ArrayList al = new ArrayList();//Open a database connection for the reader Conn.Open(); //Create the reader and execute the command adding the values to the arraylist SqlDataReader dr = Comm.ExecuteReader(); if (dr != null) while (dr.Read()) { //fill arraylist al.Add(dr\[0\]); } //Close the connection Conn.Close(); //Use the list to fill the checkbox foreach(string s in al) { checkedListBoxServices.Items.Add(s); }
//ListCheckbox code I have tried
//This one returns just the first (or last) line. I tried incrementing the row but it will not work
//foreach (DataRowView drv in checkedListBoxServices.SelectedItems)
//{
// al.Add(drv.Row[0].ToString());
//}
/////////////////////////////////These do not work at all
//int i = 0;
//int count = checkedListBoxServices.CheckedItems.Count;
//object item = string.Empty;
/////////////////////////////////
//while (i < count)
//{
// item = checkedListBoxServices.SelectedItems.ToString();
// listServices.Add(item);
// i++; -
Visual Studio 10 Naming Issue?Hello Smart...Thank you for your reply. I did not understand this, but I tried it anyway. It generated 11 errors and the application would no longer load generating the following response: "The variable "buttonUsers" was either never declared or was never assigned." I appreciate your effort. If you have another idea or if I did this wrong, please let me know. I suppose that I will have to go back and rebuild at least 12 hours of previous code to get back to where I was....Oh well. Best regards, Pat
-
Visual Studio 10 Naming Issue?Emmanuel, Thank you for your input. This happens semi often, but it never affected more than one control before. I wish I could reproduce it, but I cannot. I was hoping that you might have seen this and just knew what the heck it was that I did, not just for this time but for the next time. Anyway...I do have a backup of the app, but it will take me the better part of a day to get back to where I was...it happens that way sometimes. I appreciate the time and effort for your detailed response (and advice). Best Regards, Pat
-
Visual Studio 10 Naming Issue?On occasion,when I am programing in VS 10, I will have an issue with a control, usually a button. Apparently I do something (I do not know what) and the application "loses" the original code behind a control and renames a new identical control with the name 1 after it. Case in point:
private void buttonUsers\_Click\_1(object sender, EventArgs e) { }
The original control is still there someplace and the code is intact, but the control no longer points to it. It points to the new blank definition instead. In the past, if it was a single issue (1 control) deal, I simply recoded the new button with the code from the old one and moved on, but this time, all the buttons on the page are gone. In fact, all the buttons in the application seem to be the same way. I think it is time to find out why. I hope that someone can tell me what I am inadvertently doing to cause this and how I can recover the application to where it was. I am at a loss...I appreciate your help...Thank You ... P
-
List Box Sudden Exit On SelectionThank you Luc (nice of you to reply to me again) and to all of you in fact for your excellent replies. All are good advice and I intent to use it all. Re: The Issue; most of the time, I usually find myself embarrassed when I finally solve some of these things. I employed the following simple one line of code in the SelectedIndexChanged event to resolve the issue:
private void listBoxXxx_SelectedIndexChanged(object sender, EventArgs e)
{
if (listBoxXxx.Items.Count < 1)
{
string msg = "There are no Items in the list to select from. ";
MessageBox.Show(msg, "Required Information Missing", MessageBoxButtons.OK, MessageBoxIcon.Information);
return;
}if (listBoxXxx.SelectedIndex != -1) { labelXxx.Text = listBoxXxx.SelectedItem.ToString(); } }
To my friend and mentor Luc...actually, I looked up my history and I usually do supply the code when the issue is code failure but not when (I don't know how) which is sometimes the case. In this case, I should have supplied the following, but it was so basic I could not understand the possible link, so please accept my apology.
//Load the Main page frmMain m = new frmMain(fname, title, firm, firmId, permission, theDate, userId, chal, CONNSTR); this.Hide(); m.ShowDialog(); } } catch (SqlException Sqlex) //Catch Sql Errors { MessageBox.Show("Error: " + Sqlex, "SQL Connection Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } catch (Exception ex) //Catch All Errors { MessageBox.Show("Error: " + ex, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); return; }
Most important...thank you all for your interest and expertise. Luc, your answer was closest to what I used and I am marking it as the correct solution. Best Regards, Pat :) :)
-
List Box Sudden Exit On SelectionGentleman, I am using a list box to list some string information gathered from an MSSQL database. I noticed that if I select the box and should "miss" the string line (selecting empty space), a null exception is thrown. The problem is that it also closes the application. I have tried several different ways to escape this by showing the exception (try, catch) and trying to return to the application, but they have all failed. Ideas? Thank You, Pat
-
Query an Excel SpreadsheetOOOOKKKK..........JOAT-MON YES...you are absolutely right. There was a Streamwriter object that was called when the file was imported. I normally enclose them in a using statement so that they will close automatically, but for some reason I did not do it this time. I have made the correction and it is working perfectly now. Thank you very much for your insight. I am marking your answer as THE answer. Kudows and Best Regards, Pat
-
Query an Excel SpreadsheetHello..Thank you for your input. I agree about the connection, but this was a copied (supposedly already working code), so I left it. I removed the connection commands as suggested, but the result is the same. Let me now if you have any other thoughts...Best, Pat OK, I just saw the edit...hmmm, what can I say. I'll keep looking, perhaps try a reboot. If I find the answer, I will post it. If not, I'll have to try a different way to get to the intended result....P.
-
Query an Excel SpreadsheetThank you Dave, This is a 32 bit system and I am already configured for x86. I appreciate your reply. Let me know if anything else comes to mind or if you see a problem in the code...Best, Pat