698 Posted Topics

Member Avatar for edgias

Firstly, Please use [noparse][CODE][/CODE][/noparse] blocks when posting code. This ensures teh correct formatting to make ti more readable. Secondly, you are inserting the values if dr.HasRows == true. This should be the other way around. If dr.HasRows is true then it means the user was found in the database and …

Member Avatar for Geekitygeek
0
302
Member Avatar for CSharpUser

The problem here is that the '' character is the escape symbol for both C# [B]and[/B] WQL. Using '@' tells C# not to escape the '' but you need to tell WQL the same thing. Heres an example to try and clear it up: You enter "WHERE Drive = 'C:' …

Member Avatar for CSharpUser
0
1K
Member Avatar for SamTheDevGuru

Not the source of your problem, but you are using sender.ToString(). For controls that usually returns something like "System.Windows.Forms.TextBox, Text: <textbox.text here>". Its not in your code, but im assuming textbox is a class level variable to store a reference to the textbox, you should use textbox.Text to get the …

Member Avatar for Geekitygeek
0
498
Member Avatar for toykwon5

As adatapost says, you can use a boolean array to mark the seats as dirty. As for finding the best match location for the group, one way would be to find all suitable locations for each person, then find all combinations of those possibilities. Then for each combination you can …

Member Avatar for Geekitygeek
0
71
Member Avatar for raul01us

The problem you are going to face is that the datagridview (dgv) combobox column is not a regular combobox. Usually you can use the OnDropDown event to show a form with your table in it. But the dgv version doesnt fire these events. One option would be to use the …

Member Avatar for raul01us
0
117
Member Avatar for Rageagainst20

aah, the age old problem of "Hide known file extensions" :p remember to mark the thread as solved since you have found a solution

Member Avatar for Geekitygeek
0
187
Member Avatar for aravinda reddy

you can get the google api from [URL="http://code.google.com/"]Google[/URL], and the Bing API from [URL="http://www.bing.com/developers"]Microsoft[/URL].

Member Avatar for Geekitygeek
0
100
Member Avatar for Acute

Another option would be to use a grid of controls, such as pictureboxes. Use a simple algorythm that calculates the correct size for each based on the number per row/column and the form size then use a loop to draw them to the form. I did something similar a few …

Member Avatar for Geekitygeek
0
61
Member Avatar for nitin2010

The TargetInvocationException tells you that the method you are calling has thrown an exception. Check the InnerException property of the exception to find out what the underlying cause might have been.

Member Avatar for nitin2010
0
182
Member Avatar for vinoth.raj2k

Firstly, you should post this under ASP.NET rather than C#. Secondly, the [URL="http://www.daniweb.com/forums/announcement61-2.html"]policy [/URL]here at Daniweb is to help those who show effort so have a go for yourself then post your code to ask for help with specific problems. We're here to help, not to do the work for …

Member Avatar for Geekitygeek
-1
57
Member Avatar for Geekitygeek

Whilst flicking through someones profile, i noticed something odd. They have a reputation of 11, 213 posts, 64% quality, 6 solved threads...and they can give +3 to someones rep. I understand that the rep power is calculated on a number of things, but i have 609 posts, 92% quality, 126 …

Member Avatar for Geekitygeek
0
185
Member Avatar for ammadiqbal

You need to ensure that the MDI Child has a method called NewButton and that the method is declared as Public.

Member Avatar for ammadiqbal
0
1K
Member Avatar for NewbyOneCanuby

generally it helps to try and model the rela world example first. So, sit down and work out what attributes each part of the model needs to have. I'm guessing you are trying to write a program to deal with a race course of some sort..i'd start somewhere like: [U]Race …

Member Avatar for NewbyOneCanuby
-1
193
Member Avatar for ticktock

I think you ought to reconsider regex. It is a very powerful tool and its not that difficult to pick up the basics. You can use it to check for incorrect characters as well as specific patterns...which is vrey handy for validating things like postcode/email address/telephone number etc. We'd be …

Member Avatar for ticktock
0
180
Member Avatar for panksd

[QUOTE=adatapost;1139565]Use named-parameters [/quote] [code] cmd = new SqlCommand("insert into Insert1(sname,srno,sdob,sadd,sgender) values (@sname,@srno,@sdob,@sadd,@sgender)", cn); cmdForm.Parameters.Add("@sname", OleDbType.Char).Value = this.txtname.Text; cmdForm.Parameters.Add("@srno", OleDbType.Char).Value = this.txtrno.Text; cmdForm.Parameters.Add("@sdob", OleDbType.Date).Value = this.dob.Value cmdForm.Parameters.Add("@sadd", OleDbType.Char).Value = this.txtadd.Text; cmdForm.Parameters.Add("@sgender", OleDbType.Char).Value = this.cmdgender.Text; [/code]

Member Avatar for Geekitygeek
0
56
Member Avatar for Deey

Also, the standard event handler has two parameters, sender and eventArgs. sender will contain a reference to the control that fired the event. You need to cast it back to its correct type to access its members though: [CODE] private void Panel1_Click(object sender, EventArgs e) { Panel clicked = (Panel)sender; …

Member Avatar for Geekitygeek
0
102
Member Avatar for lee.j.baxter

you could looka t [URL="http://msdn.microsoft.com/en-us/library/system.componentmodel.backgroundworker.aspx"]backgroundworker [/URL]class. It is a thread which can report its progress back to the calling thread.

Member Avatar for Geekitygeek
0
581
Member Avatar for eliile5

if you have a working game that allows a human to play versus the computer then you have all you need. You need to locate two sections of the code: 1. The part that accepts the users move and 2. the part that automates the computers move. Just take out …

Member Avatar for eliile5
0
92
Member Avatar for iNach

If you dont understand the code given for substrings, this may be over your head for now.. but in the interest of completeness you can also use [URL="http://msdn.microsoft.com/en-us/library/system.text.regularexpressions.regex.aspx"]Regular Expressions[/URL] to match words/patterns/substrings within text. If you can be sure that your string will always have the same symbols before and …

Member Avatar for Geekitygeek
0
137
Member Avatar for JamesGeddes

I'm not sure what was wrong with your timer corey, i dropped on onto a form with two buttons and a textbox and the following code worked fine: [CODE] public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void btnStart_Click(object sender, EventArgs e) { timer1.Interval = …

Member Avatar for Cory_Brown
0
133
Member Avatar for ryang96

You will have some new errors when you fix this problem. Your error is a result of calling a variable you havent declared (as Cory_Brown correctly pointed out) but you are also making inter-thread calls which will throw errors. You can't access variables/controls in your main form from a new …

Member Avatar for Geekitygeek
0
972
Member Avatar for VibhorG

Have you checked that each of your controls is returning a valid value? eg, com_cname.SelectedValue is set and correctly formatted, etc.

Member Avatar for VibhorG
0
289
Member Avatar for phoenix911

When it logs in does it have write permission via the API or does it just retrieve the documents?

Member Avatar for phoenix911
0
169
Member Avatar for SamTheDevGuru

i have a similar setup in one of my apps. I'm not sure why you can't alter the values, i have no problems. I use the RowsAdded event to set the images and apply any styling to the rows: [CODE] private void dgvOrders_RowsAdded(object sender, DataGridViewRowsAddedEventArgs e) { for (int i …

Member Avatar for SamTheDevGuru
0
133
Member Avatar for CSW110

Firstly, its [icode]*code here*[/icode] for inline code :) Secondly, the `(Excel.Application)` is a [cast](http://msdn.microsoft.com/en-us/library/ms173105(VS.80).aspx). It tells the compiler to convert the object after it into the type within the brackets. A word of caution: if the object to be converted cannot be cast to the given type it will throw …

Member Avatar for Geekitygeek
1
193
Member Avatar for Gl0mby

use int.tryparse: [CODE] int userInput; if(int.TryParse(Console.ReadLine(), out userInput) { //input was valid } else { //error...non int value } [/CODE] TryParse accepts two parameters: string to parse, variable to store result in (reference by the 'out' keyword). It returns a boolean value to say wether it succeeded.

Member Avatar for Geekitygeek
2
125
Member Avatar for brettbed

I know this has been marked as solved, but thought i'd chime in. The reason that you are getting random numbers when you generate them at the same time you declare the array is that you are using a single instance of the Random class. You have declared one RandNum …

Member Avatar for brettbed
0
487
Member Avatar for Cardinals1980

koekoeksklok, please read the [URL="http://www.daniweb.com/forums/announcement61-2.html"]daniweb forum policy[/URL] regarding homework help. Whilst it may seem somewhat convoluted; [B]not[/B] giving him the code was the best kind of help you could have given him. By giving him the code, you have deprived him of the learning opportunity he faced if he solved …

Member Avatar for ddanbe
0
107
Member Avatar for abarlowa

[QUOTE=herbie643;1145087] Omitting the braces will cause a runtime/compile error showing that a } is required. [/QUOTE] Not necesarily true. It is recommended to always use the bracers to maintain formatting and avoid mistakes, but it isnt required if you are only executing a single statement after the condition: [CODE] if(true) …

Member Avatar for herbie643
0
84
Member Avatar for rosebabu

I know this is solved but i felt it really needed to be said: [CODE] protected override void Dispose(bool disposing) { if (disposing && (components != null)) { //components.Dispose(); // we've to comment the above line and added below line this.WindowState = System.Windows.Forms.FormWindowState.Minimized; } //base.Dispose(disposing); //u have to comment this …

Member Avatar for Geekitygeek
0
2K
Member Avatar for VJ APU

You dont need to use the string.Repalce method. you can split using the '' character, just double it up to escape it: [CODE] string path = @"C:\test\name.txt"; char[] splitchar = {'\'}; string[] nameParts = path.Split(splitchar); [/CODE]

Member Avatar for VJ APU
0
180
Member Avatar for janhoy

check out this [URL="http://msdn.microsoft.com/en-us/library/aa288452(VS.71).aspx"]msdn tutorial [/URL] for MS Access. If you need more specific help, supply more specific information about your problem. Here at Daniweb, the policy is to help those who show effort. So rather than saying "send me the code", attempt it yourself and then post here to …

Member Avatar for Geekitygeek
0
103
Member Avatar for Sujit_Patil

You need to configure your SQL Server instance to [URL="http://support.microsoft.com/default.aspx?scid=kb;EN-US;914277"]allow remote connections[/URL]. The msdn page is for sql server 2005, if you are running a different version, eithe rlet me know which or google for "remote connection" for your version. Then in your Conneciton string your dfatasource will be "Data …

Member Avatar for Geekitygeek
0
98
Member Avatar for juniorSkillz

I assume you are putting the code in the textboxes TextChanged event. You are checking if the max length of the textbox is less than 10. What you need to do is check if the length of the text entered is greater than the max length: [CODE] if (txtCustName.Text.Length > …

Member Avatar for Geekitygeek
0
1K
Member Avatar for ROTC89

As jonsca said, we'd need to see a larger code section to be sure, but it looks like you have overridden the ToString method of the Rectangle Class but are calling .ToString on the collection of rectangles. You would need something like: [CODE] Rectangle [] rects = new Rectangle[5]; string …

Member Avatar for ROTC89
0
89
Member Avatar for Yamazaki

If you are using tableadapters, i would recommend adding your own delete query. The standard ones are pretty heavy going, you have to put the value for every single column. If you add a new query to the table adapter along the lines of: [CODE=SQL] DELETE FROM [TableName] WHERE ([PrimaryKeyColumn] …

Member Avatar for Yamazaki
0
1K
Member Avatar for badx

Firstly, please use code tags when posting code: [noparse][CODE]Code goes in here[/CODE][/noparse]. Secondly, where did you get your code? If you dont know what a variable is i'm going to assume you have never coded before. Its the line 'Variables.client_ID' that is causing most of your errors. You are trying …

Member Avatar for apegram
-1
157
Member Avatar for neelu421

The two main methods of accessing the characters of a string have been mentioned here. I thought i'd also mention the string.split function. It won't split a word into characters, but it can be used to split a string into its composite substrings. I put all the methods together in …

Member Avatar for Geekitygeek
1
700
Member Avatar for TinoMclaren

I'm not sure if theres a built in way of doing it...but you could simulate it; Use the RowSelected event to change the background of the row to maintain the selected colour when the datagridview loses focus. Then each time a row is clicked use a List to store a …

Member Avatar for TinoMclaren
0
96
Member Avatar for templersstorms

This is fairly easy to achieve. You can use the CellContentClick and CellContentDoubleClick events. Check my [URL="http://www.daniweb.com/code/snippet241539.html"]tutorial [/URL]to see how to create the event handlers correctly. You will probably find it easier to use the method shown in the image at the bottom of the tutorial :)

Member Avatar for Geekitygeek
0
5K
Member Avatar for Geekitygeek

I wrote a query yesterday and it ran fine. Today i inserted a new record and it has broken my query. Can anyone help me figure out why? Query: [CODE] WITH temp_orgChart (KitID, PartID, Quantity, iteration) AS ( SELECT KitID, PartID, Quantity, 0 FROM ItemParts WHERE KitID = 200185 UNION …

Member Avatar for Geekitygeek
0
103
Member Avatar for kohkohkoh

Check the link adatapost gave you. I used the same technique recently to automate data input to a website. The trick (as mentioned in the comments of the code in the link) is to view the source of the page and locate the controls you wish to interact with. Once …

Member Avatar for kohkohkoh
0
90
Member Avatar for Cheryl Code

Hi, Firstly the error you are getting is probably a result of the int.Parse(). If the textbox is empty then the parse will fail. I highly recommend using int.TryParse instead. It outputs the result to a variable and returns a bool to indicate if the parse succeeded. It wont throw …

Member Avatar for Geekitygeek
0
114
Member Avatar for welshe200

Totally back what diamonddrake is saying. The system you are suggesting would be a huge invasion of privacy. Also, if you have multiple machines in use, you would have to flick rapidly between machines to try and watch everybody. Likewise, if you take a break or serve a customer you …

Member Avatar for Geekitygeek
0
101
Member Avatar for deathtoall141

Wow, ncie code apegram :) deathtoall141, are you copying apegrams code exactly? The code he gave you is a Console Application intended as an example. You will need to make a few changes to run it on a button click. Firstly, ensure you have correctly created your buttonclick event handler. …

Member Avatar for Geekitygeek
0
197
Member Avatar for nevds

Whilst farooqaaa's code might get it done, its cleaner to use the ItemCheck event instead. This event is called every time the check state is changed so if you double click it will fir ethe event twice (once for checking and once for unchecking). [CODE] private void checkedListBox1_ItemCheck(object sender, ItemCheckEventArgs …

Member Avatar for Geekitygeek
0
126
Member Avatar for irmak1771

There are several options: You can implement your own update query. The default update query performs the update then performs a select to return the number of rows that were affected. By writing your own, you can replace this select to return the actual rows that were affected. You can …

Member Avatar for Geekitygeek
0
176
Member Avatar for ticktock

I'm not sure your code will work. The Convert.ToString function works differently with ListviewItem and ListboxItem. You would get something like: Convert.ToString(menuList.SelectedItem) = "FoodA" Convert.ToString(orderList.FindItemWithText(currentItem)) = "ListViewItem: {FoodA}" FindItemWithText returns a ListViewItem, which has an Index property. I would use something like this: [CODE] private void menuList_SelectedIndexChanged(object sender, EventArgs e) …

Member Avatar for Geekitygeek
0
673
Member Avatar for snakay

Actually SharpJohnnyG, apegram showed the better way to do it. The items stored in an arrayList are stored as objects as the arraylsit is not type specific. As such, your code would throw an exception if one of the items in the arraylist was not an array. By iterating through …

Member Avatar for snakay
0
153
Member Avatar for bzupnick

totally agree with apegram. When accepting user input you should always validate it. FOr instance, your first question will output an answer if they enter an uppercase Y or uppercase N. If they enter a lowercase Y/N or a letter other than Y/N it will skip over the rest of …

Member Avatar for Geekitygeek
0
113

The End.