1,469 Posted Topics

Member Avatar for ahmed zidane

dbgrid? Can you tell a more please? Why you are all so shy? Dont expect any help with this kind of manner guys.

Member Avatar for adam_k
0
528
Member Avatar for karlicek

You have only declared the two dimensionaly array, but you didnt initialize it. Try to insert this line of code: [CODE] position = new int[1, 1]; //insert this line - to initialize new array! position[xx, yy] = foo.bar_name;// reason of error position[xx, yy] = load_position(x, y); [/CODE]

Member Avatar for samee1985
0
223
Member Avatar for Lowchernhwee

What is that part "wow test" doing there? There is no pattern for this text. So hard to do it simply. What do you think?

Member Avatar for Lowchernhwee
0
124
Member Avatar for dennysimon

1st you need to create columns, then you fill the row (by looping through rows of dgv): [CODE] DataSet ds = new DataSet(); DataTable table = new DataTable("DataFromDGV"); //if you have only one table, it pointless to create a dataSet //dataSet is used as a collection of more-then-one dataTable //so …

Member Avatar for dennysimon
0
6K
Member Avatar for Mitja Bonca

I would like to do the simple card game which can many people play at the same time, but not only one game, there can ne n games running. Recently I was learning how to do server-client coding, using TcpListener and TcpClient network services. But the main difference between the …

Member Avatar for l3l4c7_h4t
0
430
Member Avatar for nji2rhyme

Check this out: [CODE] Private r As New Random() Private list As List(Of String) Public Sub New() InitializeComponent() comboBox1.Items.Add("--- select ---") list = New List(Of String)() From { _ "item 1", _ "item 2" _ } For Each item As String In list comboBox1.Items.Add(item) Next End Sub Private Sub button1_Click(sender …

Member Avatar for nji2rhyme
0
78
Member Avatar for abc88

Use ExecuteNonQuery() method, instead of ExecuteScalar(). ExecuteScalar() method in only used to get, set only one value.

Member Avatar for Netcode
0
209
Member Avatar for BARATUM

You said, you want to get data into a listView, am I right? So create columns (as many as you want, based on array number of data from the file), and use ListViewItem class to populate listView (use Text property for the 1st item, and Subitems.Add() method for the rest …

Member Avatar for aldeene
0
426
Member Avatar for nji2rhyme
Member Avatar for nji2rhyme
0
338
Member Avatar for iamjess147

Try it this way: [CODE] Dim days As Integer = 12 'your value from DB! (one or the other - didnt know what you want Dim months As Integer = 5 'your value from DB! Dim [date] As DateTime = DateTime.Now 'some date ! 'get new date (current date + …

Member Avatar for Mitja Bonca
0
146
Member Avatar for KnifeDarky

Do you type in textBox both vlaues? So your textbox after finishing writing looks like: [CODE]textbox "label1.text = "bla bla"" "msgbox.show"[/CODE] With or without quotation marks?

Member Avatar for KnifeDarky
0
1K
Member Avatar for bhagawatshinde

Momerath had to point. What does it take so much to co create 100 files? Next - if your code (and computer) is capable of 100 per 10 minutes, then this is it! You actually cant make the same files two times faster.

Member Avatar for Ketsuekiame
0
100
Member Avatar for bhagawatshinde

What kind of dataBase? If you know which one you have, check for the correct conn. string [URL="http://www.connectionstrings.com/"]here[/URL].

Member Avatar for bhagawatshinde
0
214
Member Avatar for mrbungle

INSERT statement should go like: [B]INSERT INTO DataBaseTable VALUES (value1, value2, ...)[/B] So, yours statement is incorrect.

Member Avatar for mrbungle
0
145
Member Avatar for zachattack05

If column is marked as Primary Key, then is not chance of having two same values at all. But what you can do, is to change the type of the primary key column to varchar, and add some character to the actual id, like A or B. Exmple: if id …

Member Avatar for lolafuertes
0
214
Member Avatar for auwi987

I assume you are dealing with Access database, thats why you are trying to use question marks (???) when defining Values(in here), righ? Correct way, only some part is missing. You actually have to specifry the column names and not using question marks. Questio marks are only used in Update …

Member Avatar for Mitja Bonca
0
128
Member Avatar for Lowchernhwee
Member Avatar for fadeterra
Member Avatar for fadeterra
0
332
Member Avatar for DeathEater

Here you go: [CODE] public Form1() { InitializeComponent(); //adding some example columns: //1. column is checkBox, rest of 2 are some usual column: DataGridViewCheckBoxColumn checkColumn = CreateCheckBoxColumn(); dataGridView1.Columns.Add(checkColumn); dataGridView1.Columns.Add("col2", "Column 2"); dataGridView1.Columns.Add("col3", "Column 3"); //adding some example rows: for (int i = 1; i <= 10; i++) { dataGridView1.Rows.Add(false, "item …

Member Avatar for DeathEater
0
105
Member Avatar for yousafc#

On each button click you would like to increment it by 5? Or what is that for loop there?

Member Avatar for ddanbe
0
141
Member Avatar for bradploz

Is the connection string correct? And you really sure that name and password are really ok,and that the user exists in db?

Member Avatar for debasisdas
0
129
Member Avatar for yousafc#

[CODE] //1. to get a total of LastBalace: "SELECT SUM(LastBalance) FROM Students"; //2. to get the last LastBalance "SELECT MAX(LastBalance) FROM Students"; //3. to get a specifc lastBalance "SELECT LastBalance FROM Students WHERE StudentID = @id"; //pass an integer value to @id parameter! /use SqlCommand(of OleDbCommand for Access) class. //And …

Member Avatar for yousafc#
-2
104
Member Avatar for yousafc#
Member Avatar for yousafc#
0
190
Member Avatar for chellemits

If you selected only one file, you dont need a foreach loop. You use it when you have multiple files. So what you can do is this: [CODE] public Form1() { InitializeComponent(); label1.Text = ""; } private void button1_Click(object sender, EventArgs e) { OpenFileDialog open = new OpenFileDialog(); open.Filter = …

Member Avatar for Mitja Bonca
0
393
Member Avatar for abc88

Hi, try this code bellow, but just make sure the DateTims are do not have hours, minutes or seconds. They onlymust have days, months and years (hours, minutes and seconds must be on zero, like "7.11,2011 0:00:00". [CODE] Private Sub Method() Dim dates As DateTime() = New DateTime(2) {} dates(0) …

Member Avatar for Mitja Bonca
-1
673
Member Avatar for chellemits

try using Threading: [CODE] Imports System.Collections.Generic Imports System.ComponentModel Imports System.Data Imports System.Drawing Imports System.Text Imports System.Windows.Forms Imports System.Threading Namespace WFInvoke Public Partial Class Form1 Inherits Form Public Sub New() InitializeComponent() End Sub <STAThread> _ Private Shared Sub Main() Application.Run(New Form1()) End Sub Private Sub IncrementMe() 'Instead of this loop use …

Member Avatar for sgt_toasty
0
151
Member Avatar for sherinpoulose

[QUOTE=sherinpoulose;1608330]I have to divide dataset into training dataset(80%) and test dataset (20%) using random sampling.[/QUOTE] What do you mean by dividing?

Member Avatar for sherinpoulose
0
1K
Member Avatar for BARATUM

Try to write a full path to the file: [CODE]Dim writer As New System.IO.StreamWriter("C:\MyFolder\myFile.txt", False)[/CODE]

Member Avatar for adam_k
0
173
Member Avatar for mike2098

[QUOTE] ... the additional columns I want to display are flatNo, houseNo and street [/QUOTE] Where do you hold these data?

Member Avatar for Mitja Bonca
0
394
Member Avatar for ruchi18

As they said: if you really have no base, its better to study other "simplier" things 1st. I was trying to do sometihng similar for some of my projects (to inform customers with sms), but I let it go, becuase in my country for something like it, I would need …

Member Avatar for emond
0
232
Member Avatar for bhagawatshinde

Yep, as nmaillet showed. You have two option, or to access to class`s constructor (his 1st upper example), or to access any of your methods in your base class (his 2nd example).

Member Avatar for Mitja Bonca
0
155
Member Avatar for jerome2467
Member Avatar for jerome2467
0
120
Member Avatar for Brissac
Member Avatar for Brissac
0
109
Member Avatar for Saidar

Take a look at this simple example, which shows how to use a new thread (thread is busy with some loop), and shows how to use delegates to update progressBar: [CODE] using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text; using System.Windows.Forms; using System.Threading; namespace WFInvoke { …

Member Avatar for Mitja Bonca
0
997
Member Avatar for Marc Smets

I can see you use DataTable as a binding source to the dgv control. So you can use filtering on the dataTable, with a help of "SELECT" method: [CODE] Private table As DataTable Public Sub New() InitializeComponent() table = New DataTable("MyTable") table.Columns.Add("Id", GetType(Integer)) table.Columns.Add("Name", GetType(String)) table.Columns.Add("Car", GetType(String)) table.Rows.Add(1, "Name 1", …

Member Avatar for Marc Smets
0
382
Member Avatar for chellemits

What path? This is the one you wrote, how do we know your path mate??! I have changed the code a bit, to what I think its best: [CODE] 'WRITE CORRECT PATH FILE HERE: Dim filePath As String = "C:\\Documents and Settings\\Mitchikels\\My Documents\\AVDC\\Downloaded Files" If System.IO.Directory.Exists(filePath) Then Dim myDir As …

Member Avatar for chellemits
0
1K
Member Avatar for dibakarmishra

Loop through the rows of DGV, and check is there is at least one checkBox checked. If there is, Enable the button, if not, leave it Disabled (this is in case if you will check on some button click event, and not when checking ot unchecking a comboBox) If you …

Member Avatar for dibakarmishra
0
185
Member Avatar for Oneryavuz

Pass every image to this method bellow: [CODE] 'in your method: Private bImage As byr() = ImageToByteArray(yourImage) 'method Public Function ImageToByteArray(imageIn As System.Drawing.Image) As Byte() Dim ms As New MemoryStream() imageIn.Save(ms, System.Drawing.Imaging.ImageFormat.Gif) Return ms.ToArray() End Function [/CODE]

Member Avatar for Oneryavuz
0
683
Member Avatar for Weliaz

On which line do you get this error? Is it maybe on line 33 in this line of code: [CODE] Timer1.Interval = 100[/CODE] It seems you didnt initialize a new timer. On form load (or in constructor) instanitate a new instance of a timer: [CODE] Dim Timer1 As New Timer() …

Member Avatar for Mitja Bonca
0
109
Member Avatar for markdean.expres

There is. use SelectionAlignment property: [CODE]richTextBox1.SelectionAlignment = HorizontalAlignment.Center[/CODE]

Member Avatar for Mitja Bonca
0
70
Member Avatar for amond

YOu wanna pass data from ListView to the TextBoxes on some other Form (and create them as many as needed too)? If so, 1st of all do NOT change Modifiers property to public. Leave them as private, and rather gather all the data from listView, put then into some collection …

Member Avatar for Mitja Bonca
0
104
Member Avatar for ninjatalon

It looks like you need to create a new Thread. This will salve the issue of frozen form. Put the time consuming code onto this thread, and use a progressBar to show the updating of the work. Instead of using Thread you can use Backgroundworker class.

Member Avatar for AnkitGuru
0
140
Member Avatar for markdean.expres

YOu have to use CellValidating event: [CODE] Private Sub dataGridView1_CellValidating(ByVal sender As Object, _ ByVal e _ As DataGridViewCellValidatingEventArgs) _ Handles dataGridView1.CellValidating Me.dataGridView1.Rows(e.RowIndex).ErrorText = "" Dim newInteger As Integer ' Don't try to validate the 'new row' until finished ' editing since there ' is not any point in validating …

Member Avatar for Mitja Bonca
0
98
Member Avatar for priyamtheone

The best and simpliest option is to use MaskedTextBox (instead of TextBox). You only have to define the mask property: [CODE] maskedTextBox1.Mask = "000,000,000,000.00" [/CODE]

Member Avatar for Mitja Bonca
0
181
Member Avatar for mwenyenia07

Maybe this will help: [CODE] Imports System.Windows.Forms Imports CrystalDecisions.CrystalReports.Engine Imports CrystalDecisions.Shared Namespace WindowsApplication1 Public Partial Class Form1 Inherits Form Public Sub New() InitializeComponent() End Sub Private Sub button1_Click(sender As Object, e As EventArgs) Dim cryRpt As New ReportDocument() cryRpt.Load("PUT CRYSTAL REPORT PATH HERE\CrystalReport1.rpt") Dim crtableLogoninfos As New TableLogOnInfos() Dim crtableLogoninfo …

Member Avatar for Mitja Bonca
-1
201
Member Avatar for DeathEater

Hi, would you mind to share your code here with us? Will be easier to salve the problem. Show us how you bind DGV to the dataTable (and stuff).

Member Avatar for DeathEater
0
125
Member Avatar for Pro2000

YOu can do a windows application, which will work fine over the net (like msn, skype,..). You need to create a server (which is always good to have, to check what going on around) and then you need clients to log on to server and chat to each other. One …

Member Avatar for Pro2000
0
306
Member Avatar for Makumza

[CODE] //in your method: string text = "Some text to crypt"; string crypt = Crypt(source); //calls: private string Crypt(string input) { MD5CryptoServiceProvider hasher = new MD5CryptoServiceProvider(); byte[] data = hasher.ComputeHash(Encoding.UTF8.GetBytes(input)); StringBuilder sb = new StringBuilder(); foreach (byte b in data) sb.AppendFormat("{0:x2}", b); return (sb.ToString()); } [/CODE]

Member Avatar for Mitja Bonca
0
103
Member Avatar for k80sg

What is your DB structure? Would you like to delete whole row (if date is older then 1 day)?

Member Avatar for Mitja Bonca
0
120
Member Avatar for luckyismb

Yep. [CODE] SqlCommand cmd = new SqlCommand(@"query", "connection"); SqlDataReader reader = cmd.ExecuteReader(); if(reader.HasRows) { } else MessageBox.Show("No rows found."); [/CODE]

Member Avatar for Mitja Bonca
0
66

The End.