698 Posted Topics
Re: Every language has its own pro's and con's and I'd recommend you guys do some research into which best meets your requirements...it'll look good in your thesis for one and will help you choose correctly for another. If you have a limited time frame and a large project to code, … | |
Re: Which selected index changed event does it go to? | |
Re: Check out the [URL="http://msdn.microsoft.com/en-us/library/ms723602(v=VS.85).aspx"]SpVoice object in the Speech API[/URL]. You could create a new message box class inheriting from the old one and adding a voice prompt to the Show() method using SpVoice.Speak(). | |
Re: You could move the array to its own class with an indexer then expose an instance of that class through your property: [CODE] public partial class Form1 : Form { public Form1() { InitializeComponent(); } //store instance of the class holding your array private Resource _resource = new Resource(); //expose … | |
Re: Could you post an example of the data sent and data received so we can see what is going back and forth? If we have a clearer idea of the whats being sent and received we may be able to offer a better solution. | |
Re: Try changing your parameter names from: [CODE] UpdateCommand.Parameters.Add("[Department]", OleDbType.Char).Value = textBox2.Text; UpdateCommand.Parameters.Add("[Description]", OleDbType.Char).Value = textBox1.Text; [/CODE] to [CODE] UpdateCommand.Parameters.Add("@Department", OleDbType.Char).Value = textBox2.Text; UpdateCommand.Parameters.Add("@Description", OleDbType.Char).Value = textBox1.Text; [/CODE] I dont think your supposed to use the field name as the parameter name | |
Re: OK, from the top: Firstly, please use [noparse][code][/noparse][i]your code here[/i][noparse][/code][/noparse] tags when posting code. It maintains the formatting to make it easier to read. Secondly, your for loop counter needs amending; if the Count of items in a collection is 5, then the index of the last item is 4. … | |
Re: You can't; an event handler cannot return a value. An event can potentially invoke many methods in different objects, if the event handlers allowed return values, each could potentially return a different value so your event would have multiple return values. Where are you trying to "return" the arraylist to? … | |
Re: Its a [URL="http://connect.microsoft.com/VisualStudio/feedback/details/433391/microsoft-visualstudio-datadesign-syncdesigner-syncfacade-syncmanager-error"]known issue[/URL]; an incompatibility between VS2008 RTM and SP1. The error is a result in an incomplete SP1 installation. Try reinstalling SP1 to see if it resolves it. | |
Re: Can you be more specific about what you are stuck with? ddanbe has given you the code for properties if you need advise on any of the other requirements let us know, but you need to make an attempt and we can help you trouble shoot specifics. | |
Re: The SelectCommand accepts an instance of the SqlConnection class, not just the query string. Try [iCODE]sqlDataAdapterSearch.SelectCommand = new SqlCommand("SELECT * FROM Customers WHERE (CustomerID LIKE'" + textBoxSearch.Text + "')"); [/iCODE] Although you may want to look at using [URL="http://msdn.microsoft.com/en-us/library/system.data.sqlclient.sqlcommand.parameters.aspx"]parameters[/URL] to make your code easier to read/debug. | |
Re: finito, i think you may have confused an index with a unique id...that or i'm misreading your explaination. An index is a transparent process that you can enable in sql server. When you create an index on a column of a table, the server will keep a record of each … | |
Re: Just a note, you probably want to use myLife.TotalSeconds; Seconds returns the seconds portion of the timespan where as TotalSeconds returns the whole of the TimeSpan converted to seconds. For example, if the TimeSpan is equal to 3 minutes and 25 seconds then: Seconds == 25 TotalSeconds == (3 * … | |
Re: if you want to pass information back and forth the easiest way is to pass a reference to the parent form into the child form. See [URL="http://www.daniweb.com/code/snippet298708.html"]my tutorial[/URL]. | |
Re: I would generally advise against using literal file paths (eg C:/Users/You/MyDocuments/etc) because you can't guarantee the file structure on every machien that runs your code. Either add the image as [URL="http://www.daniweb.com/code/snippet258293.html"]an embedded resource[/URL] and access it from there or add it to your project as content so that it is … | |
Re: Was it really necessary to resurrect a thread over a year and a half old just to pitch a .net component? | |
Re: [QUOTE=finito;1288205]I only see one Array which isn't even defined correctly. should be [CODE]int[,] average = new int[5,3] { { 87, 68, 94 }, { 100, 83, 78 }, { 85, 91, 76 }, { 65, 81, 66}, {65, 71, 56 }};[/CODE] [/QUOTE] Whilst I am a strong advocate of daniwebs … | |
Re: Please refrain from creating duplicate posts | |
Re: Take a look at the [URL="http://www.daniweb.com/code/snippet299495.html"]tutorial[/URL] i wrote. It shows how to show/hide current form when opening a new one. The text portion also outlines how you can close the first form instead of showing it. When you open a new form it gets added to the Application.OpenForms collection which … | |
Re: I'm always dubious about using SendKeys...as Teme says, its not the most reliable method of control. Mine isnt a perfect solution either, but its a viable workaround (in my opinion). Since you can only expand the directory if it has SubDirectories, the code below checks for their existance. If there … | |
Re: [QUOTE=nick.crane;1281239]I checked this out and it is not as simple as I first thought. For some reason the index of [I]e.Row.Index[/I] is not the same value as the row entered after first edit is applied. You will need to capture [iCODE]e.Row.Index-1[/iCODE] in [I]UserAddedRow[/I]. Also, to enable the edit row you … | |
Re: In line with what nick and babbu said, you can modify or overload your constructor. Either add a boolean parameter to the standard constructor or leave your standard constructor parameterless and add a second constructor whioch takes a boolean value: [CODE] public partial class frmSubCDetails : Form { public frmSubCDetails() … | |
Re: You are correct; reader.hasrows DOES check if the datareader has retrieved any rows, and if you had used "SELECT * FROM EnrollTbl" and the table was empty then reader.HasRows would have returned false. However, you used an aggregate function (MAX). These ALWAYS return a value. If there is no data … | |
Re: Another way to do it is to pass a reference to the First form into the Second so that the second form can access public memebers of the first. [URL="http://www.daniweb.com/code/snippet298708.html"]My tutorial[/URL] outlines how to acheive this. | |
Re: You can use either a [URL="http://msdn.microsoft.com/en-us/library/0b0thckt(VS.71).aspx"]class[/URL] or [URL="http://msdn.microsoft.com/en-us/library/ah19swz4(VS.71).aspx"]struct[/URL]. The syntax is very similar; structs have a smaller footprint i believe, and are used where the data is immutable. Create your class/struct, add variables to store the different data values, then use [URL="http://msdn.microsoft.com/en-us/library/x9fsa0sw(VS.80).aspx"]properties[/URL] to access them. You can then store each … | |
Re: What data type is the Issued_Date column in your database? | |
Re: Whilst your method works fine finito, you are creating extra work for yourself. As nick.crane pointed out, you can set a DialogResult value in the buttons properties. If you set a buttons DialogResult to OK, if the form is opened modally then when you click it the Form's DialogResult value … | |
Re: The problem is that you are opening your connection, then closing it and disposing of it, then trying to use it with your sqldatareader. Check [URL="http://msdn.microsoft.com/en-us/library/system.data.sqlclient.sqldataadapter.aspx"]the code here[/URL]. First of all, place the connection inside a "using" block. This ensures the connection is correctly closed and disposed when the using … | |
Re: If you want the login form to close and a new form to be shown, why not create the new form from your main form. You are showing the login form modally (ShowDialog) so when you close login the code execution will resume in the main form. Use the login … | |
Re: Are you using a datagrid or a datagridview? | |
Re: Try using the FormattedValue rather than the Value. If you are binding to a database you are likely using a bit column which holds 0 or 1. If the value isnt set it will return null so be sure to check for null values when you check them to avoid … | |
Re: If you have received help, please remember to mark the thread as solved | |
Re: I assume when you say you crated a Session that you mean you have stored their EmailID in teh session varaible. If thats the case you will need to create a connection to your database and use a Select query to retreive rows where EmailID = Session["EmailID"]. Try reading [URL="http://msdn.microsoft.com/en-us/library/system.data.sqlclient.sqldataadapter.aspx"]this[/URL] | |
Re: I'm confused : / If the datagridviews are bound to different tables, what are you trying to acheive by transposing rows? Can you show the table structures? If your database is normalised correctly you should be storing data specific to the contact in the Contacts table. Why would you want … | |
Re: Two things... 1) Is there a typo in your Groups table? You have Group_ID and Contact_ID, which is a duplicate of the Members table. 2) I showed you how to construct a select query to limit returned rows by group in [URL="http://www.daniweb.com/forums/post1288629.html#post1288629"]your other thread[/URL]. | |
Re: You can specify a format string when using Datetime.ToString() to set how the string is constructed. Check out [URL="http://www.geekzilla.co.uk/View00FF7904-B510-468C-A2C8-F859AA20581F.htm"]this link[/URL], has a very handy list of possible format strings and a reference for building your own. | |
Re: You can also add parameters to your commands. This makes your code much more readable and easier to work with if your query has a few parameters: [CODE] int current_group = 1; SqlDataAdapter adp = new SqlDataAdapter("select * from gmembers where GID = @GID", con); adp.SelectCommand.Parameters.AddWithValue("@GID", current_group); [/CODE] | |
Re: Also, I would recommend checking [URL="http://www.daniweb.com/code/snippet298708.html"]my tutorial[/URL] on accessing form controls/members from other forms. Your 'ent' variable is specific to the current instance of the form, static members should be common across all instances. My tutorial shows how to use a property to access a private member. Properties are a … | |
Re: Feed me and I Live, Give me water and I Die What Am I? | |
Re: I think your best bet would be to use the Login form Modally. Use FormInstance.ShowDialog() to show a modal instance of the form. Modal forms prevent the user from moving focus to other forms until they are closed. They also allow you to use the DialogResult property. Another useful behaviour … | |
Re: Not even :/ Did you check the link Lusipher posted? It showed you how to use a modal form: [CODE] shiftAlter_edit_Form6 form6 = new shiftAlter_edit_Form6(storedFileArray, loc); form6.ShowDialog(); [/CODE] Code execution will pause on the current form until form6 is closed. You wont be able to move focus to any other … | |
Re: Timers have a Tick event. You set an interval value (in milliseconds) and start the timer. Once started the tick event will be executed at the determined interval until you stop the timer. If you want text to scroll across the screen you will need some way to display it … | |
Re: I agree with Lusipher that you need to look through your code and find where the list is being filled initially. Once you have that code you can use it to fill the list any time you need to refresh it, and putting it in a method makes it more … | |
Re: Thats because you're only reading one line. [iCODE]newstxt.Text += x.ReadLine();[/iCODE] reads a single line from the stream. Use either x.ReadToEnd or use a while loop to itereate through each line with x.ReadLine. If you use a loop you will need to look at the x.EndOfStream property. | |
Re: There is a [URL="http://msdn.microsoft.com/en-us/library/system.windows.forms.progressbar.aspx"]ProgressBar control[/URL] available as standard on Winforms. Add the control to your form, set the maximum and minimum values, then increment its Value property to show progress. You dont have to use 1 to 100 for the max and min, if for instance you were loading 35 … | |
Re: I was just gonna say "Cos its good practice"..j/k The use of properties (as clearly covered above) gives better control over how access is granted. This is all part of Object Oriented practices..more specifically [URL="http://en.wikipedia.org/wiki/Object-oriented_programming#Encapsulation"]Encapsulation[/URL]. | |
Re: You can use the datagridview.SelectedRows property to retreive a collection of the currently selected rows. Alternatively, you can add an unbound CheckBox column to the datagriview. Then itereate through all rows to check the value of teh checkbox column. | |
Re: are you reading the file in a method contained in your form class? When you execute code in the same thread as the UI the UI will pause until the code has finished executing. If the file is taking a while to process your UI will show as "Not Responding" … | |
Re: Im not sure if theres a way to do it automatically, but you could do it manually. Iterate through each of the datarow's cells and insert them into the table. You will need to be careful how you do it though. You need to ensure that there are enough rows … | |
Re: The text changed event arguments dont include "e.KeyChar" because the event is not always fired by a keypress. If you use the Textbox.KeyPress event, the event args will include the KeyChar value to show which key fired the event. It should be ntoed at this point that the KeyPress event … |
The End.