291 Posted Topics

Member Avatar for atrusmre

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.

Member Avatar for JerryShaw
0
2K
Member Avatar for choudhuryshouvi

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 …

Member Avatar for Ramy Mahrous
0
125
Member Avatar for williams1987

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.

Member Avatar for williams1987
0
165
Member Avatar for Ratte

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 ) …

Member Avatar for JerryShaw
0
222
Member Avatar for knowledgelover

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 ?

Member Avatar for binoj_daniel
0
563
Member Avatar for venkatu2005

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 …

Member Avatar for Jugortha
0
219
Member Avatar for knowledgelover

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.

Member Avatar for knowledgelover
0
100
Member Avatar for shaim
Member Avatar for taffer23

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 …

Member Avatar for taffer23
0
87
Member Avatar for Annieken

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). …

Member Avatar for Annieken
0
102
Member Avatar for waterfall

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 …

Member Avatar for waterfall
0
157
Member Avatar for JerryShaw

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

Member Avatar for Dani
0
175
Member Avatar for Gaurav arora

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 …

Member Avatar for JerryShaw
0
211
Member Avatar for avinash1986

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 = …

Member Avatar for aminit
0
154
Member Avatar for meary

Sounds impossible. Can you post some code ? maybe there is s syntax error or something else.

Member Avatar for meary
0
110
Member Avatar for Gadrel
Member Avatar for Gadrel
0
105
Member Avatar for clarkkent

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

Member Avatar for JerryShaw
0
126
Member Avatar for aminit

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 …

Member Avatar for JerryShaw
0
157
Member Avatar for eranga262154

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]

Member Avatar for JerryShaw
0
111
Member Avatar for emilio

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 …

Member Avatar for emilio
0
129
Member Avatar for GermanD

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 …

Member Avatar for GermanD
0
94
Member Avatar for sean_morris9

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 …

Member Avatar for JerryShaw
0
125
Member Avatar for Demond

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 …

Member Avatar for Demond
0
122
Member Avatar for brightline

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 …

Member Avatar for JerryShaw
0
125
Member Avatar for aminit

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 …

Member Avatar for aminit
0
207
Member Avatar for fishsqzr

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. …

Member Avatar for Jugortha
0
311
Member Avatar for IT_Techno

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.

Member Avatar for IT_Techno
0
211
Member Avatar for btech_Saurabh

Can you define the problem you are having ? Are you referring to a Toolstrip or something else ?

Member Avatar for btech_Saurabh
0
110
Member Avatar for asif08

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 …

Member Avatar for srinunarra
0
103
Member Avatar for abidbhat

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 …

Member Avatar for Killer_Typo
0
191
Member Avatar for bhuman

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.

Member Avatar for Ramy Mahrous
0
80
Member Avatar for fishsqzr

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 …

Member Avatar for JerryShaw
0
159
Member Avatar for shadowrider

[code] string constr = string.Format( "Data Source={0};Initial Catalog={1};Integrated Security=SSPI", YourServerName,YourDatabaseName); [/code]

Member Avatar for Jx_Man
0
170
Member Avatar for chaitanya_D24
Re: Hi

You are not by chance trying to run the application from a network share or mapped drive ?

Member Avatar for JerryShaw
0
81
Member Avatar for complete

Check the project properties to see where it is placing the end result. If it is showing success, it means it wrote something somewhere.

Member Avatar for JerryShaw
0
58
Member Avatar for r2k32

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 …

Member Avatar for JerryShaw
0
200
Member Avatar for Prodian

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 …

Member Avatar for JerryShaw
0
82
Member Avatar for waterfall

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.

Member Avatar for blacklocist
0
119
Member Avatar for jigoro

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 …

Member Avatar for Kerjo
0
92
Member Avatar for rohitnegi09

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 …

Member Avatar for rohitnegi09
0
91
Member Avatar for raghu.8

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 …

Member Avatar for waterfall
0
221
Member Avatar for genuis1

select [Arabic_Term], [English_Term] from [databse].[dbo].[mytable] where [ID]=123

Member Avatar for jireh
0
126
Member Avatar for rayben
Member Avatar for stabiloGenuis

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, …

Member Avatar for Jugortha
0
180
Member Avatar for Ravenous Wolf

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 …

Member Avatar for latitude7ds
0
100
Member Avatar for raghu.8

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 …

Member Avatar for raghu.8
0
232
Member Avatar for ConfusedMuchMor

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 …

Member Avatar for JerryShaw
0
280
Member Avatar for csy

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 …

Member Avatar for JerryShaw
0
111
Member Avatar for ConfusedMuchMor

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

Member Avatar for JerryShaw
0
104
Member Avatar for LMR

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]

Member Avatar for alc6379
0
176

The End.