291 Posted Topics
Re: It appears that it does it correctly because the space after the comma is also a token. You can either add a new sep ", " (with a space) or break the string into multipe Splits, and combine them later. | |
Re: Another approach is to use Generics. List<int> x = new List<int>(); x.Add(0); x.Add(1); ..... as many as you want, as often as you want. When/If you ever need to use it as an array, you can always do this: int[] z = x.ToArray(); The advantage here is that you can … | |
Re: Each time you use the ReadLine method, it will move the poistion marker in the stream to the next line. so you can keep using the same method to populate the other text boxes. textBox1.Text = streamreader1.ReadLine(); textBox2.Text = streamreader1.ReadLine(); textBox3.Text = streamreader1.ReadLine(); // and so on. | |
Re: A better approach is to see if it exists through sysObjects, and create it there, catch any errors on that. [code] IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[Country_Master]') AND type in (N'U')) CREATE TABLE [dbo].[Country_Master]( [County_id] [int] IDENTITY(1,1) NOT NULL, [CountryName] [varchar](50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ) … | |
Re: First step would be to log the error message to the event log so you know what went wrong. Does this code work from a standard app ? | |
Re: Once you get all the stuff Ramy told you to do on your form, use the CellClick event of the grid to get at the data on that row. You must check to be sure the user has selected a valid row. Row header, and Column headers return a value … | |
Re: Is your service setup to interact with the users desktop ? If not, the program will launch and will show up in task manager under processes, but the user will not see it. | |
Re: try changing the colon to a period | |
Re: You should probably have a date field in the table, otherwise all you can do is assume a new record was added each day, and get the most recent. Your question is a bit ambigious. Databases do not automatically get the next row, they store data. It is up to … | |
![]() | Re: I am not real sure on what you are trying to do. However, maybe this will help. Each time that you instantiate a new Burst collection variable, then assign it a value, and then set the datasource of the list box to the new Burst collection (discarding the old one). … ![]() |
Re: I tried answering this morning, but the network connection failed. Sorry for being late :) The Insert statement does not allow a Where clause. I will assume that your Employee table has a column named "EmployeeName" or some place to put the name value. It would not make sense to … | |
Please get rid of that darn Ask.com advertisement when writing private messages. When trying to write a message, the Enter key causes the Ask.com search page to launch. Makes it very frustrating to write a message. Jerry | |
Re: Gaurav, Its been awhile since I worked with SQL7, but it doesn't matter, they are almost all the same, except for the connection string. The easiest way to find out what the connection string should be is to use Visual Studio's Data menu then Add New Data Source... option. Select … | |
Re: Do you mean ReadLn ? Forgive me if there are syntax errors, typing this is off the top of my head. [code] StreamReader reader = File.OpenText("C:\\MyFile.txt"); string line = reader.ReadLine(); while (line != null ) { // do something with the line. Assume a delimiter of Tab string Name = … | |
Re: Sounds impossible. Can you post some code ? maybe there is s syntax error or something else. | |
| |
Re: Are you trying to start it as a service ? Have you tried using a shell command "net start mongrel_service" or use a ServiceController component to launch it ? // Jerry | |
Re: AMINIT, This looks like the same program you sent to me earlier this week that I fixed for you. Did you not get the zip file I sent back ? The problem is the way you declare the out of class timer. The way it is defined, means it will … | |
Re: The Start method syntax allows you to pass a string array to the onStart event handler of the windows service: [code] string[] args = new string[2]{"Hello","World"}; serviceController1.Start(args); [/code] | |
Re: The reason is that the compiler can see that there is the possibility that the condiotnal statement could be false, and therefore it can fall through to the next case statement.. which is illigal. So to fix the problem, always be sure that the case either returns, or does a … | |
![]() | Re: Sounds like a Timing issue <no pun intended> First I dislike the use of timers for the very reason you have stated. Instead I prefer to use threads... but that is just me. I suggest that you use the single timer to do all the work since it is all … ![]() |
Re: Load the image into a byte array. Pass the byte array into a memory stream Pass the memory stream into a new or existing bitmap. [code] byte[] b = (byte[])adm["Image_image"]; System.IO.MemoryStream stream = new System.IO.MemoryStream(b, true); stream.Write(b, 0, b.Length); Bitmap bmp = new Bitmap(stream); [/code] Error checking, null checking, etc … | |
Re: Sounds like the program is busted... or has a dependency. If the program needs a dll, or some other object from its local directory (where it is running) it will break if the file it needs is missing. If the program can be launched in its debug directory (without VS … | |
Re: You can save any size file, or image or anything else that you want into an SQL database. This capability has been around even back when SQL was SyBase. The Text field is a BLOB field. Use a byte[] array, and stream the file into the field through a memorystream … | |
Re: I have attached a Visual Studio 2005 project (as a zip file) that shows how to save your values from the form to a text file, and as an added bonus, a way of bringing those values back from a text file. It uses a couple recursive methods . There … | |
Re: I prefer using the SqlCommand as well. One approach is to create a method (even perhaps a static method) that you can pass a T-SQL statement, and it does all the work, or you can pass a stored procedure name and a array of parameters for the proc to use. … | |
Re: use a NotifyIcon component. Use the FormClose event handler of your form to cancel the close. However you need to provide some method of allowing them to close the app. See NotifyIcon on google or MSDN for a number of examples. | |
Re: Can you define the problem you are having ? Are you referring to a Toolstrip or something else ? | |
Re: Yes this board seems to attract students wanting someone else to do their homework. Think about it, If you give them all the answers, and they end up with a degree in computer science, then get a job at your business, and end up on your team...you can only blame … | |
Re: If you are trying to launch the application from a different machine across the network, then yes you will get this error until you make it a trusted application. There are a number of security setting that have to be made, and there is a couple free utilities on the … | |
Re: What Ramy said plus specifically look at FileInfo to get the file name, use the name property with the string.split function to break it up. If you are scanning an entire directory then consider looking at the DirectoryInfo's getfiles to get an array of fileinfo. | |
Re: Yes to both questions. Bind the Combobox to the table or a bindingsource, and set the DisplayMember to what you want shown in the Text property and the ValueMember to the key data. Now if you want to do this as an unbound control, then you will need to use … | |
Re: [code] string constr = string.Format( "Data Source={0};Initial Catalog={1};Integrated Security=SSPI", YourServerName,YourDatabaseName); [/code] | |
Re: You are not by chance trying to run the application from a network share or mapped drive ? | |
Re: Check the project properties to see where it is placing the end result. If it is showing success, it means it wrote something somewhere. | |
Re: The code looks basicaly correct, however a couple things to point out. 1) You should avoid creating procs that start with "sp_" because this tells SQL to first look in the system procedures. 2) In your proc, you may consider also testing to see if that username already exists, and … | |
Re: Your problem is in the NINI code. I have attached my TiniFile class library with source for you to use in place of the NINI library. It has just about anything you would ever need to work with an ini file. If you find something it doesn't do, drop me … | |
Re: SQL has the ability to store any type of data into a blob field. Just stream the data into the column. There are many examples on Code Project, and other sites on how to do this. | |
Re: Not a smart idea, and an easy way to get into a legal jam if the forced logout causes loss of data in another application. But, if you inisit on this insanity, you could register your application to restart in the registry, then call the Win API call to force … | |
Re: You should explain your issue in more detail. Getting data from a table is simple. Getting text from a textbox is simple. It is not very clear on what you want to do with the data or the text. What kind of database ? Are you going to use data … | |
Re: Simply write an event handler on the SelectedIndex change of the combobox to adjust the item for the second. On the second, have another event handler that sets the textbox value. You can populate a Combo using objects that contain the matching information to go into the text box. Is … | |
Re: select [Arabic_Term], [English_Term] from [databse].[dbo].[mytable] where [ID]=123 | |
Re: This error occurs simply because you do not have a user established on that SQL server with that name. If the user is Windows Authenticated, then it will use the logged in user name and domain [domain]\[logged in user name]. If "STS-SYNMAC\userName" is not a valid user in that domain, … | |
Re: Ravenous Wolf, Can you provide a sample of the code (your repeated 16 lines segments ). Yes you can create control arrays. If you find yourself typing the same 16 or so lines for multiple controls, it begs for a method to perform that action. Give us some code that … | |
Re: raghu, That SQL statement should have thrown some errors. I assume you are using Microsoft SQL. First off, it is typically not a good idea to use commandtext. Instead use stored procedures whenever possible. Although you are adding parameters to the CMD, because the CMD type is CommandText those parameters … | |
Re: ConfusedMuchMor, as scru mentioned a [B]field[/B] aka property, variable or parameter that holds a value or collection of values. You can assign values to and get values from these types of objects. A [B]method[/B] on the otherhand is a piece of executable code. It may return nothing (void) or return … | |
Re: If you are referring to placing another form into a Panel on the Main form, this should really be done using a UserControl. However, [code] Form2 fm2 = new Form2(); fm2.TopLevel = false; fm2.Dock = DockStyle.Fill; panel1.Controls.Add(fm2); fm2.Show(); [/code] You can put a form into another control (such as a … | |
Re: I didn't find this error when I compiled it. I optimized it a bit, and set the voice default (which you did not.. which might have something to do with it. Anyway, I have attached my version of your project for your review. Jerry | |
Re: Don't know if this will help you but you can get the Time of a DateTime using the TimeSpan [code] DateTime data = new DateTime(2007, 11, 10, 13, 15, 0); TimeSpan time = data.TimeOfDay; // time.ToString() returns "13:15:00" [/code] |
The End.