- Strength to Increase Rep
- +7
- Strength to Decrease Rep
- -1
- Upvotes Received
- 35
- Posts with Upvotes
- 30
- Upvoting Members
- 26
- Downvotes Received
- 1
- Posts with Downvotes
- 1
- Downvoting Members
- 1
Moving from Delphi to C#. Many years in SQL development. When not programming, I ride horses.
- Interests
- Morgan Horse Shows
Well I guess it is my turn to ask a question, since most of the time I spend answering questions on DaniWeb. The Problem: DataViewGrid throws a "System.ArgumentException parameter is not valid..." when the dataset contains an SQL 2005 TimeStamp type column. The error occurs in System.Drawing.FromStream... da da da … | |
Re: There are a number of ways to do this. Using directing insert statement is one, another is using a stored procedure, calling as ssis package is another. The easiest is probably the insert statement. Simple get you SqlConnection, then use an SqlCommand. use the string.Format method to parse the data … | |
| |
Re: I sugest you take a different tact. What I typically do for managing thread messages is I create a simple EventArgs class to hold the message information, a Delegate to represent the main thread method that will use the information, and an eventhandler in the main thread that can be … | |
Re: Let me re-state your question to see if I understand you correctly. You have two forms. First form has a check list box, and the second form has a listbox. When the user checks an item in the check list box, you want that item to be added to the … | |
Re: As danielernesto said, store it to a column type that supports byte arrays such as Image or VarBinary(max). // Jerry | |
Re: [URL]http://www.thescripts.com/forum/thread224354.html[/URL] | |
Re: I have attached a project that demonstrates how to do this. Jerry | |
Re: #3, you can't stop it from sending the a minimize command (without some Windows API calls), however if you want it to do more things before it minimizes, you can use the Deactivated Event handler or the SizeChanged event ([URL]http://www.thescripts.com/forum/thread275452.html[/URL]). If you want to stop the minimize action, then you … | |
Re: Doesn't close because the while statement runs out of reads, and drops into the dr & lgnconnection close... It does not make sense to have both the true and false of a conditional result in the same statement "Close()". Why compare at all if the result is always going to … | |
Re: Instead of using a private bool variable, use a private variable for Form2, then you have some options... [code] public partial class Form1 : Form { private Form2 _form2 = null; public Form1() { InitializeComponent(); } private void button1_Click(object sender, EventArgs e) { button1.Enabled = false; _form2 = new Form2(); … | |
Re: Are you speaking of the Header cells, or a data cell ? I havn't tried it on tried it on the header, however I am pretty sure it can be done. If you are speaking of data cells, you can use the CellFormatting([COLOR=#0000ff]object[/COLOR] sender, [COLOR=#008080]DataGridViewCellFormattingEventArgs[/COLOR] e) CellFormatting event to set … | |
Re: Writing an ini parcer is pretty straight forward. I have attached a class library that I use, and included the source code for you to check out. | |
Re: Yes you can do this. I have a service that does this type of work for archiving files. Remember that a mapped drive is in the context of the currently logged on user. A Windows service runs in its own context. So, your mapped drive may not be visible to … | |
Re: As BlackSun explained, you will need to manage it yourself using the image Graphics. It is a bit more complicated than the example above, but should move you into the right direction. The image onPaint event will have to remember that you have an active selection (the rectangle, and its … | |
Re: What Ramy is saying is that you do not specify a File name, but rather a ConnectionString. [code] SqlConnection conn = new SqlConnection("Data Source=Servername;Initial Catalog=Marketing;Integrated Security=SSPI"); conn.Open(); [/code] | |
I have the multiple level path of a filename, and I want to pull out just the immediate parent directory name of this file. Example: Filename = "c:\temp\extra\test\myfile.txt" How can I get "test" from this string ? Thanks in advance Jerry | |
Re: "Give same Code ??" Do you mean giving them all the same event handler ? then let the event handler determine the button that was used ? | |
Re: Another hint for you, Your assignment says to compute the rate at 7.5 for the first 40 hours, and 11.25 for each additional hour. Your condition is only checking for if the hours equal exactly 40 hours then use 7.50, else use 11.25. So with your condition, if worked any … | |
Re: It all depends on when you are letting the user delete the file. Even through the dialog is closed, does not mean it has been disposed by garbage collection. To insure you no longer have the picture file handle open, before closing the dialog (or in the FormClosed event handler), … | |
Re: Instead of mangling the SQL statement (embedding CRLF), just iterate through the rows and columns, and populate the text box. Here is a simple example: [CODE] private void toolStripButton1_Click(object sender, EventArgs e) { SqlConnection conn = new SqlConnection("Data Source=SHAWHP;Initial Catalog=SalonWiz;Integrated Security=True"); conn.Open(); DataSet ds = new DataSet(); SqlDataAdapter adapter = … | |
Re: Here is a snip of code from my Login screen. It has the usual Server Name, User name and Password texboxes, and a Login and Cancel button. Mine is hardcoded for a database named SAFEnet. This is using the SQLclient (SQL2005). If you are using another type DBMS, let me … | |
Re: You will be wrapping the code that creates the database anyway, so just supply good error messaging and go with the assumption. IOW, why add additional code when SQL is going to do those checks for you anyway regardless of your pre-checks. JMO | |
Re: Why so much code? Try this to get started [code] static void Main(string[] args) { string[] meals = System.IO.File.ReadAllLines("meals.csv"); foreach (string meal in meals) Console.WriteLine(meal); Console.ReadKey(); } [/code] | |
Re: Look at [URL]http://msdn2.microsoft.com/en-us/library/system.windows.forms.keypresseventargs.keychar.aspx[/URL] then after e.Handled = true; set focus to the next control / textbox. | |
Re: Are you aware that the Jet engine is very picky about the dBase file version. This is why I prefer to use the ODBC classes instead of Ole. I had a similar problem using your code, and after switching it out to use ODBC, everything worked fine, and even a … | |
Re: First, your ASP is the one connecting to the database using the credendials of the web site setup. (Windows authentication mode). You are to validating the information from the login screen against the database. Just keep in mind that SQL sees the web service as the one logged in not … | |
Re: ***what is MyGrid referring to in this code ^^^ ???*** [U]Answer: A DataGridView[/U] ***hi ... how to create the stored procedure?, and how to call the stored procedure in c# ?.... *** [U]Answer: Creating a stored procedure is done at the SQL Server using the tools provided by the database … | |
Re: [code] ************************************************************************************************** private void ShowForm(DataTable dtDagChauff) { if (FrmZTour == null ) { FrmZTour = new FrmDgvZoomTour(); FrmZTour.SelectTour += new FrmDgvZoomTour.SelectTourHandler(DgvTourSelected); FrmZTour.FormClosed += new FormClosedEventHandler(FrmZTour_FormClosed); FrmZTour.Show(this); } FrmZTour.FillDgv(dtDagChauff); } private void FrmZTour_FormClosed(object sender, FormClosedEventArgs e) { FrmZTour.Dispose(); FrmZTour = null; } [/code] | |
Re: What you need is a place in your MyProgram.cs class to store the command line arguments received in the constructor (Main). Something like public string SelectedFile; In the Main constructor, do this: [code] public static void Main(string[] args) { string SelectedFile; if (args.Length > 0) { SelectedFile = Convert.ToString(args[0]); MessageBox.Show(SelectedFile); … |