1,469 Posted Topics

Member Avatar for dibakarmishra

And if all checkBoxes will be unchecked, the button has to be Disabled (or Invisible) again? You can create some class boolean flag, which will be set to true, as soon as you check at least one checkBox (or even better would be to create a counter, so you wont …

Member Avatar for adam_k
0
1K
Member Avatar for bklynman01

Your error is in the Update query. You mixed up one and double quotes. Do it this way: [CODE] sqlSOPDept.CommandText = "UPDATE dbo.docHeader SET revision = '" & newRev & "' WHERE model = '" & Convert.ToString(Me.cmbModel.SelectedValue.ToString) & "' AND part = '" & Convert.ToString(Me.cmbPart.SelectedValue.ToString) & "'" [/CODE]

Member Avatar for Mitja Bonca
0
274
Member Avatar for udigold1

to create events, put the code in form constructor. [CODE] //on form1: public Fomr1() { InitializeComponent(); this.Load += new System.EventHandler(Form1_Load); } private void Form1_Load(object sender, EventArgs e) { //this will now fire at loading time! } [/CODE]

Member Avatar for ddanbe
0
562
Member Avatar for arsalanghouri

[CODE] int myVariable = 0; using (SqlConnection sqlConn = new SqlConnection("connString")) { using (SqlCommand cmd = new SqlCommand(@"SELECT MAX(MyColumnName) FROM MyTable", sqlConn)) { using (SqlDataReader reader = cmd.ExecuteReader()) { if (reader.Read()) { if (reader.GetValue(0) != DBNull.Value) myVariable = (int)reader[0]; } } } } [/CODE]

Member Avatar for Momerath
0
153
Member Avatar for arsalanghouri

Why would you change the primary key? You shouldn`t do that. Thats why Primary keys are for - they stay the same until forever. What in case if this table of yours is connected to some other table, abnd there is a foreign key? you will get different data when …

Member Avatar for zachattack05
0
153
Member Avatar for shers

What represents "Value" and "Count"? Are these two properties of a custom class?

Member Avatar for Unhnd_Exception
-1
180
Member Avatar for Naveed_786

You can use a textBox, so when there is no focus on it, it will remain as textBox (it will look like it). When use clicks on this textBox, then create a new DTP (on the same position as this textBox), create over it (so textBox will be bellow DTP). …

Member Avatar for debasisdas
-2
94
Member Avatar for mrar85

Hi, I would suggest you to use ReadLine() method, not ReadToEnd(). This way you avoid some additional code, which would be needed if you would use ReadToEnd() method. So after using ReadLine() method, you get a string of text line by line. Each line will habe the shape of you: …

Member Avatar for mrar85
0
344
Member Avatar for luckyismb

Please tell us more about it. Which values would you like to save (insert) into DB? From selected row or some else? Would you like to insert as soon as you check some checkBox, or after checking some of the checkBoxes and do the insert on a button click? There …

Member Avatar for Mitja Bonca
0
113
Member Avatar for ejazmusavi

Remove that name out of connection string, use only this: [CODE]Data Source=\sqlexpress; AttachDBFilename=F:\\Projects\\MyProj\\FirstProj\\bin\\Debug\\Database\\MyDB.mdf;Integrated Security=ture; User Instance=true; [/CODE] or: [CODE]"Data Source=.\\SQLEXPRESS;AttachDBFilename=F:\\Projects\\MyProj\\FirstProj\\bin\\Debug\\Database\\MyDB.mdf;Integrated Security=ture; User Instance=true;[/CODE]

Member Avatar for k.d.m
0
139
Member Avatar for apanimesh061

An interface is a reference type object with no implementation. You can think of it as an abstract class with all the implementation stripped out and everything that is not public removed. Abstract classes are classes that can not be instantiated. No properties or methods are actually coded in an …

Member Avatar for k.d.m
0
108
Member Avatar for jas2010

try this code: [CODE] public Form1() { InitializeComponent(); this.KeyPreview = true; this.KeyUp += new KeyEventHandler(Form1_KeyUp); } private void Form1_KeyUp(object sender, KeyEventArgs e) { if(e.KeyCode == Keys.Tab && e.Shift) { } } [/CODE]

Member Avatar for prasan7
0
91
Member Avatar for BillyMagic

Hi, check for an example code [URL="http://stackoverflow.com/questions/400140/how-do-i-automatically-delete-tempfiles-in-c"]here[/URL], and use C# to VB [URL="http://www.developerfusion.com/tools/convert/csharp-to-vb/"]converter[/URL].

Member Avatar for BillyMagic
0
484
Member Avatar for kapojian

YOu cannot "embade" Access dataBase into your project, as for example you can do with MS SQL Express dataBase. What you can do is to use a connection string with explicitly setting the path to the dataBase, and then is expected that the dataBase has to be there on that …

Member Avatar for kapojian
0
85
Member Avatar for Dr peter

Here is a simple example using Randiom class: [CODE] static void Main(string[] args) { Random r = new Random(); int[] numbers = new int[5]; //lets create an integer array (here we only create indexes, no values inside yet for (int i = 0; i < numbers.Length; i++) //lets loop through …

Member Avatar for shiva07
0
140
Member Avatar for ShadyTyrant
Member Avatar for k.d.m

sknake: but you need a server to do this validation. What in case if there is no server available? No options at all?

Member Avatar for skatamatic
0
110
Member Avatar for kapojian

Depends on what he has in mind to put together and what to seperate from other data.

Member Avatar for kapojian
0
328
Member Avatar for xanawa

[URL="http://www.connectionstrings.com/"]Here[/URL] you will find how to create the right connection string.

Member Avatar for k.d.m
0
117
Member Avatar for arsalanghouri

Check [URL="http://forums.asp.net/t/1186309.aspx/1?c+access+database+insert+problem"]here[/URL], how you need to do Insertions into Access dataBase (using OleDb commands).

Member Avatar for kapojian
0
206
Member Avatar for zifina

Scroll text ok, but what did you mean by "if the text do not fit into the label..." ? ADDED: Text always fits to the label.

Member Avatar for zifina
0
3K
Member Avatar for kapojian

So: chicken 11/2 fish 1 egg 1 are all in its lines in database? Is your dataBase field type of varchar? But it doesnt matter. You cannot declare any height and width of a cell. YOu can only split text using some delimiters, which will later help you to split …

Member Avatar for kapojian
0
151
Member Avatar for zifina
Member Avatar for zifina
0
133
Member Avatar for symeramon

The DataGridView does not have any support for merging cells. You can custom paint content across cells, but apart from that you would have to do a lot of work and custom coding to produce merged editable cells. Go [URL="http://www.codeguru.com/forum/showthread.php?t=415930"]here[/URL], and check the code.

Member Avatar for symeramon
-1
357
Member Avatar for lianpiau

You will have to popualte DGV "manually". Row by row, column by column. You cannot use any dataSource, because you have to change a value. Unless if you do the binding and then go through all the rows in paint time, and change the values in partiucular column. But this …

Member Avatar for Mitja Bonca
0
839
Member Avatar for yousafc#

How come? if connection string is ok, and table is not empty, Momerath`s solution has to work. His query and use of ExecuteScalar method returns the number of rows.

Member Avatar for yousafc#
0
269
Member Avatar for eoop.org

What exactly do you mean with "make a login system"? isnt kapojian`s solution ok? What exactly do you want? What you need is a connection string to succesfully connect to database, its structure, to knnow the table names and their fields, so you are able with a help of query …

Member Avatar for skatamatic
0
171
Member Avatar for zachattack05

It can be possible in both side. Which do you prefer. nmaillet just showed how it will be look like a stored procedure. If you wanna do in code (C#) you can do it: [CODE] int a = int.Parse(textBox1.Text); //but do better checked to make sure if user does not …

Member Avatar for zachattack05
0
97
Member Avatar for zachattack05

There is many options. If you want to save as DateTime, you will not be able to save as an array. Because only one value of dateTime can be stored into one cell. You can choose a varChar - that means converting dateTime values into a string, and seperated them …

Member Avatar for zachattack05
0
2K
Member Avatar for ToniSoft

Simpliest way to do so, it touse ShowDialog method: [CODE] //in the main form: using(Login log = new Login()) { if(log.ShowDialog() == DialogResult.OK) { Application.Run(Form1); } } //in login form: //when you do all the checking on the user`s name and password //and all is OK, do: this.DialogResult = DialogResult.OK; …

Member Avatar for ToniSoft
0
116
Member Avatar for thing2

In your method GetInput you have a parameter, which you do NOT pass it. Do it this way: [CODE] public static void Main(string[] args) { DisplayApplicationInformation(); string someName = "this is some name"; GetInput(someName); //here you have to put a parameter to pass with a method } public static void …

Member Avatar for Mitja Bonca
0
240
Member Avatar for udigold1

Csv files uses as a delimiter comma ",", or semicolon ";". Try with one of them.

Member Avatar for alc6379
0
203
Member Avatar for MagnetoM

Try it this way: [CODE] while (reader.Read()) { textBox1.Text = reader["Grey3"] != (object)DBNull.Value ? (string)reader["Grey3"] : String.Empty; } [/CODE]

Member Avatar for Mitja Bonca
0
88
Member Avatar for leo88

Depends on number of columns. For example if you have 3 columns you do: [CODE] foreach (DataRow row in dt.Rows) { object obj1 = row[0]; //column 1 object obj2 = row[1]; //column 2 object obj3 = row[2]; //column 3 } [/CODE]

Member Avatar for leo88
0
138
Member Avatar for kapojian

This post of yours has no much of a point. "[I]the selected value from my database[/I]" There is no such thing as selected value in dataBase. Please, be more specific of this issue of yours.

Member Avatar for kapojian
0
1K
Member Avatar for leo88

1st of all, there is no word about Interfaces - there is a completely different expression. You wanna talk aobut Forms. Ok? So, please in the future use this term - Form. What you can do, is to create a seperate class, with property (property is a "field" which uses …

Member Avatar for sametyildirim
0
366
Member Avatar for jmurph333

I dont think that this is possible - to disable just one item. Better option to be removing it from the list.

Member Avatar for jmurph333
0
94
Member Avatar for yousafc#

Some strange sql query. Why would you compare those two table, when you only want to get all the data from Studentinfo table. Admission table has nothing to do here, since you do get any data from Admission table. So I recommend you to change the query to: [CODE] Select …

Member Avatar for yousafc#
0
127
Member Avatar for amjad shah
Member Avatar for masterjiraya

You cant. The Form2 was stared as the Main form in the Main method. You can only Hide it (use this.Hide() method), if you will close it, the whole application will close.

Member Avatar for Mitja Bonca
0
201
Member Avatar for c#Programmer

Hi, you can have a server like where its now, but if you want that the application will work, the 1st important thing is that the server is running. 2nd whats important is the connection string. It must include the server`s IP address, so the application on the other computer …

Member Avatar for Mitja Bonca
0
110
Member Avatar for bigzos

You didnt add the newly created dataGridiView to the form. Do it this way: [CODE]Dim dgv As New DataGridView() Me.Controls.Add(dgv) 'this line you are missing[/CODE]

Member Avatar for pixma
0
201
Member Avatar for mrbungle

Try this code: [CODE] Private table As DataTable Public Sub New() InitializeComponent() table = New DataTable("myTable") table.Columns.Add("column 1", GetType(String)) table.Columns.Add("column 2", GetType(String)) table.Rows.Add("a1", "b1") table.Rows.Add("a2", "b2") table.Rows.Add("a3", "b3") table.Rows.Add("a4", "b4") dataGridView1.DataSource = New BindingSource(table, Nothing) End Sub Private Sub button1_Click(sender As Object, e As EventArgs) Dim selectedRow As DataRow = …

Member Avatar for mrbungle
0
2K
Member Avatar for sweetangel_9311

Hi, 1st, point is that you have the same columns, ok its not really necessary, but its good when you want to copy a row from on dataGrid to anoter to have at least the same number of columns and that are the same type (even all can be parsed …

Member Avatar for Mitja Bonca
0
126
Member Avatar for majorawsome

1st time you SET it. 2nd time oyu get it. Simple. If you want to read, 1st you have to set it, then when is set, you can ge it. Example: [CODE] class a1 { a2 a; private void methodA() { a = new a2(); a.MyText = "something to set"; …

Member Avatar for shiva07
0
174
Member Avatar for staticclass

Go to your Properties of the Project (in solution explorer right mousr click on your project name). It will open a new tabPage of Properties. Go to "Publish" tab. Now select all the prerequisites you want to install. And ot the bottom select when (how) you want them to be …

Member Avatar for staticclass
0
1K
Member Avatar for astha_malik

This is not possible. You can color the text, but only int one color. If you want to have two or more color, there is a work-around. Create labels, and put them in the position of the groupBox text. Color the what eve you want.

Member Avatar for Mitja Bonca
0
107
Member Avatar for Tortura

lol, he is not a genious. He only knows more. jfarrugia btw, next time what is the code, you have to put it into code brackets! I hope you understand (forum rules).

Member Avatar for Mitja Bonca
0
237
Member Avatar for coroll

This is not how we do the method in "correct" way. I put the correct word into quotation marks, becuase everything is correct as long as the code works, but there wre have some rules we have to follow, so the code is more appropriate and looks better and works …

Member Avatar for Mitja Bonca
0
106
Member Avatar for vaishnu

And [URL="http://www.codeproject.com/KB/buttons/zhaocolorbutton.aspx"]here[/URL] is one link to custom button control.

Member Avatar for vaishnu
0
140

The End.