1,469 Posted Topics
Re: dbgrid? Can you tell a more please? Why you are all so shy? Dont expect any help with this kind of manner guys. | |
Re: 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] | |
Re: 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? | |
Re: 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 … | |
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 … | |
Re: 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 … | |
Re: Use ExecuteNonQuery() method, instead of ExecuteScalar(). ExecuteScalar() method in only used to get, set only one value. | |
Re: 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 … | |
Re: What the code outputs now? Is it not ok? tell us whats wrong. | |
Re: 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 + … | |
Re: 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? | |
Re: 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. | |
Re: What kind of dataBase? If you know which one you have, check for the correct conn. string [URL="http://www.connectionstrings.com/"]here[/URL]. | |
Re: INSERT statement should go like: [B]INSERT INTO DataBaseTable VALUES (value1, value2, ...)[/B] So, yours statement is incorrect. | |
Re: 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 … | |
Re: 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 … | |
Re: Try to chanve dateChanged with dateSelectec event.! | |
Re: Where, on which line of code this error appears? Please use a break point. | |
Re: 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 … | |
Re: On each button click you would like to increment it by 5? Or what is that for loop there? | |
Re: Is the connection string correct? And you really sure that name and password are really ok,and that the user exists in db? | |
Re: [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 … | |
Re: You can simply disable textBox: [CODE]txtage.Enabled = false;[/CODE] | |
Re: 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 = … | |
Re: 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) … | |
Re: 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 … | |
Re: [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? | |
Re: Try to write a full path to the file: [CODE]Dim writer As New System.IO.StreamWriter("C:\MyFolder\myFile.txt", False)[/CODE] | |
Re: [QUOTE] ... the additional columns I want to display are flatNo, houseNo and street [/QUOTE] Where do you hold these data? | |
Re: 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 … | |
Re: 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). | |
Re: What kind of data do you have, and what to replace? thx for the answer. | |
Re: To access to particular dataBase, you only need the correct connection string. | |
Re: 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 { … | |
Re: 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", … | |
Re: 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 … | |
Re: 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 … | |
Re: 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] | |
Re: 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() … | |
Re: There is. use SelectionAlignment property: [CODE]richTextBox1.SelectionAlignment = HorizontalAlignment.Center[/CODE] | |
Re: 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 … | |
Re: 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. | |
Re: 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 … | |
Re: 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] | |
Re: 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 … | |
Re: 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). | |
Re: 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 … | |
Re: [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] | |
Re: What is your DB structure? Would you like to delete whole row (if date is older then 1 day)? | |
Re: Yep. [CODE] SqlCommand cmd = new SqlCommand(@"query", "connection"); SqlDataReader reader = cmd.ExecuteReader(); if(reader.HasRows) { } else MessageBox.Show("No rows found."); [/CODE] |
The End.