95 Posted Topics
Re: Hi! Is this line causing error ???? curdate = CType(drdate.Item("now()"), Date) The first code block you attached is the [U]stack trace[/U], which helps to get information about the error occurring in our program. | |
| |
Re: Hi! Found this code: [CODE]Function objGetComputerSystem() As ManagementObject Dim objectQuery As New ObjectQuery("select * from Win32_ComputerSystem") Dim searcher As New ManagementObjectSearcher(objectQuery) Dim computerSystem As ManagementObject Dim computerSystemOut As ManagementObject computerSystemOut = Nothing For Each computerSystem In searcher.Get() computerSystemOut = computerSystem Exit For Next computerSystem Return computerSystemOut End Function Function renameComputer(ByRef … ![]() | |
Re: Hi! You populate value of lstResult2 here: (Read comment within code) [CODE] void ShowValues() { lstResult2.Items.Clear(); ' this clears the previous value for (int i = 0; i < values.Count; i++) lstResult2.Items.Add(values[i]); lblSum.Text = values.Count.ToString(); }[/CODE] | |
Re: Hi! I did it like the attached code, I used CommandButton, you can use ToolBar's Button and set its state to "Pressed" and "UnPressed": [CODE] Private Sub Bold_Click(sender As Object, e As EventArgs) If Not richTextBox1.SelectionFont.Bold Then richTextBox1.SelectionFont = New Font(DirectCast(richTextBox1.SelectionFont.Clone(), Font), richTextBox1.SelectionFont.Style Or FontStyle.Bold) Else richTextBox1.SelectionFont = New Font(DirectCast(richTextBox1.SelectionFont.Clone(), … | |
Re: Hi! you need to write your file in a proper manner to retrieve information back. For Primary number, in a .txt file there is no way to create a column having type "Autonumber" you need to read the file and extract the max ID and when inserting increment the ID … | |
Re: Hi! These links can help you: (if need help let me know) [URL="http://www.codeproject.com/KB/grid/Drag_Drop_from_GridView.aspx"]http://www.codeproject.com/KB/grid/Drag_Drop_from_GridView.aspx[/URL] [URL="http://www.dreamincode.net/forums/topic/48140-drag-and-drop-in-datagridview/"]http://www.dreamincode.net/forums/topic/48140-drag-and-drop-in-datagridview/[/URL] [URL="http://www.codeproject.com/KB/cpp/DataGridView_Drag-n-Drop.aspx"]http://www.codeproject.com/KB/cpp/DataGridView_Drag-n-Drop.aspx[/URL] *EDIT**** This will give you an idea how you can accomplish the task. You should execute these project(s) OR code and see the result first. | |
Re: How did you perform update ??? any piece of code for us ??? | |
Re: In richtextbox1.TextChanged Event you should check that it contains your desired text or not, for that use .FIND() method to get index of it, then select then whole keyword and color it like this: [CODE]Dim i As Integer = richtextbox1.Find("Not Found AS OF:") 'See other constructors also richtextbox1.Select(i, "Not Found … | |
Re: Hi! >>>>I have setup seven fields in my database as bits and in data sources I have labeled them as CehcekBoxes. However, I can not bind a CheckBox to a field. You can fill dataset from your database and can create a datagridview column. Then set its "DataPropertyName" property to … | |
Re: Hi! Please check this: [URL="http://www.codeproject.com/KB/vb/InsertUpdateDeleteSearch.aspx"]http://www.codeproject.com/KB/vb/InsertUpdateDeleteSearch.aspx[/URL] | |
Re: See this link how to delete/update result(s): [URL="http://www.codeproject.com/KB/vb/InsertUpdateDeleteSearch.aspx"]http://www.codeproject.com/KB/vb/InsertUpdateDeleteSearch.aspx[/URL] | |
Re: Hi! Please check these links: [URL="http://msdn.microsoft.com/en-us/library/system.data.common.dataadapter.update%28v=vs.71%29.aspx"]http://msdn.microsoft.com/en-us/library/system.data.common.dataadapter.update%28v=vs.71%29.aspx[/URL] [URL="http://www.daniweb.com/forums/thread92528.html"]http://www.daniweb.com/forums/thread92528.html[/URL] | |
Re: If you still have some time then I can help you: (please check the code I provided in a separate Project) [CODE] '''''''' Your Dynamic textboxes, this will be created at runtime. Dim tb1 as new TextBox() With {.Text="adrian"} Dim tb2 as new TextBox() With {.Text="sigamoney"} Dim tb3 as new … | |
Re: try this: [CODE]Thread.Sleep(17*1000 / (1000*1000*1000))[/CODE] argument takes time in millisecond. So, 3 times 1000 is to create 10^9 and 17*1000 is to remove its arguments' millisecond. | |
Re: You can Publish your application from menu "Build->Publish YourApplication". It will create .exe file for installation. Is this what you are looking for ??? | |
Re: Goto "Properties Window", [U]select DatagridView[/U] and changed the property "ReadOnly" to "true". This will lock all rows and all columns. | |
Re: Hi! Change the For Loop with this: [CODE] For Each row As DataRow In dataCity.Rows ListBox1.Items.Add(String.Concat(row.ItemArray)) Next[/CODE] Actually the for loop "adatapost" suggested will just take "string", so if you have integers in row it won't include it in array. So, you can use [B]"String.Concat()"[/B] method for this purpose. | |
Re: Hi! This can help you: [CODE] Dim defaultBtnSize As Size Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load defaultBtnSize = Button1.Size End Sub Private Sub Button1_MouseEnter(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.MouseEnter Me.Button1.Size = New Size(100, 50) End Sub Private Sub Button1_MouseLeave(ByVal sender … | |
Re: Hi! Create a "DataGridViewCellStyle" object and set its "format" according to your need: [CODE] Dim style As New DataGridViewCellStyle() style.Format = "dd-MM-yyyy" DataGridView1.Columns("Date").DefaultCellStyle = style[/CODE] A simple demo: (change connectionstring, cmdtext to make this sample working) [CODE] Dim con As New OleDb.OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & Application.StartupPath & "\db1.mdb" & ";") … | |
Re: Do you mean that you have textboxes in your forms and you want to store information in a text file when Form closes and retrieve information back when form loaded. | |
Re: Hi! >>> i added the database in project How did you add ??? you mean from menu "Data->Add New Data" Source ??? because it makes DataSet bydefault otherwise we need to go with OleDb class to work with it. | |
Re: You should write your for loop like this: [CODE]for (int i = 0; i < (dt.Rows.Count)[B] - 1[/B]; i++) //Since index is zero based. double ext = Convert.ToDouble(dt.Rows[i][B].Item(0)[/B]); //Value of first cell will be provided to convert[/CODE] | |
Re: You could try like this: 'To select top 2 rows from 2 out of 6 columns Select Top(2) Column1, Column2 from YourTable 'To select all rows from 2 out of 6 columns Select Column1, Column2 from YourTable | |
Re: Hi! Another approach could be using ColumnName instead of ColumnIndex: Check this: [CODE] Private Sub DataGridView1_CellEndEdit(ByVal sender As System.Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles DataGridView1.CellEndEdit If DataGridView1.CurrentCell.OwningColumn.HeaderText = "CustID" Then If DataGridView1.CurrentCell.Value <> Nothing AndAlso Not IsNumeric(DataGridView1.CurrentCell.Value) Then MessageBox.Show("Please enter numeric value.") End If End If End Sub Private Sub … | |
Re: You can follow this link: (it is for MSAccess, but will let you know how to do that) Instead of OLEDB Classes you can use SqlClient's Classes like: SqlConnection SqlCommand SqlDataREader etc..... [URL="http://www.codeproject.com/KB/vb/InsertUpdateDeleteSearch.aspx"]http://www.codeproject.com/KB/vb/InsertUpdateDeleteSearch.aspx[/URL] | |
Re: Hi! My guess for writing this line differently: dateString(s.Length - 1) = New String is that anything which is a [B]ValueType [/B]assigns a default value.See this: [URL="http://msdn.microsoft.com/en-us/library/aa904377%28v=vs.71%29.aspx"]http://msdn.microsoft.com/en-us/library/aa904377%28v=vs.71%29.aspx[/URL] Cheers!!! | |
Re: Can you please elaborate more ??? The things I understood from your question now is that: You have a database, named "datacs" which have a table "Student" that have following attributes: name->name of student sem->Semister rollno->student roll no pho1-> ????? Please explain: >>>>roll no i have entered now i have … | |
Re: Hi! Add a CLASS in your project, name it "DataAccess". Add this line at start of the class just created: [CODE]Imports System.Data.SqlClient[/CODE] Paste the code block you have in the second attachement. Then only this line may cause an error: HandleConnection(cnInsert) It should be a method in the same class … | |
Re: Hi! I found some problems in your code i.e., declare variable(s) with appropriate type and consider conversion where necessary Your line 13 should be: [CODE]Dim child as Double = CDbl(l8.Text) / 2[/CODE] and Line 15: [CODE]child2 = child * CDbl(Cb3.Text)[/CODE] Similarly line 17 - 20: [CODE] Dim adult As Double … | |
Re: Can you post your code what you have now for managing username collection ?? So that we can move further. | |
Re: Hi! Try this: [CODE] If txtSQL.Text = "" Then txtSQL.Text = chlTableCols.GetItemText(chlTableCols.SelectedItem.ToString) Else If Not (txtSQL.Text.Contains(chlTableCols.SelectedItem.ToString)) Then txtSQL.Text = txtSQL.Text & "," & chlTableCols.GetItemText(chlTableCols.SelectedItem) Else txtSQL.Text = "," & txtSQL.Text txtSQL.Text = txtSQL.Text.Replace("," & chlTableCols.GetItemText(chlTableCols.SelectedItem), "") txtSQL.Text = txtSQL.Text.TrimStart(",") End If End If[/CODE] | |
Re: One possibility is that you can query on DataSets' Table using LINQ. I will provide you example if required. | |
Re: Hi! I made this sample, which saves the combobox item when application terminates and load and select the combobox last saved item when application starts: [CODE] private void Form1_FormClosing(object sender, System.Windows.Forms.FormClosingEventArgs e) { System.IO.StreamWriter wr = new System.IO.StreamWriter("C:\\abc.txt"); wr.WriteLine(ComboBox1.Text); wr.Close(); } private void Form1_Load(System.Object sender, System.EventArgs e) { if ((System.IO.File.Exists("C:\\abc.txt") … | |
Re: Hi! Your update should be done like this: [CODE]//==========To Update con.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=|DataDirectory|\Records.mdb;Persist Security Info=True;Jet OLEDB:Database Password=registerme" con.Open() constr = "Update TableName SET ColumnToSet=" & AnyValue & "YourPrimaryKey=" & anyValue" cmd =New OleDb.OleDbCommand(constr,con) cmd.ExecuteNonQuery() //===============To re-bind after Update constr = "select * from Sections" da = New OleDb.OleDbDataAdapter(constr, con) … | |
Re: Hi! Does it help you ?? [url]http://jimmyzblog.com/asp-net/administrator/custom-validation-summary-server-control-with-custom-errors/[/url] | |
Re: Hi! >>>>I imagine I need to place this code in the form load event It depends on your need when you want your combobox to fill. So, use appropriate event for that. Here is a Form_Load event sample code in a link that might help you: [URL="http://social.msdn.microsoft.com/Forums/en/Vsexpressvb/thread/8844df20-9c56-47b5-8023-3d5b38d454d2"]http://social.msdn.microsoft.com/Forums/en/Vsexpressvb/thread/8844df20-9c56-47b5-8023-3d5b38d454d2[/URL] Also these two … | |
Re: You can change this: [code] foreach (ListItem ls in ListBox1.Items) { bnr.Write(ls.Text); } [/code] With this as well: [code] foreach (object ls in ListBox1.Items) { bnr.Write(ls.ToString()); } [/code] | |
Re: Hi! This might help you: Follow this link: [URL="http://www.codeproject.com/KB/recipes/hexencoding.aspx"]http://www.codeproject.com/KB/recipes/hexencoding.aspx[/URL] OR this is the code for your help to give you a start: [CODE] int number = 4; string str = Convert.ToString(number, 2); //Convert 4 in binary [/CODE] | |
Re: Try this: After line 18 of your code provided to us, write these LOC: Dim bmp as System.Drawing.Bitmap = new System.Drawing.Bitmap(PictureBox1.Image) bmp.Save("FILENAME.jpg", System.Drawing.Imaging.ImageFormat.Jpeg) | |
Re: Can you show your table structure ??? like: [B]Field Datatype[/B] vr_no int . . . . . . etc... because my guess is that you are getting "Nothing" in "mydataa" and to check this, first i need to know the structure of table to help you. | |
Re: Hi! I will prefer VB.Net, the reason is that it provide some functionality which i found preferable to me. 1) When I created a button both in C# and VB.Net and double clicked on it, at code behind btn_Click code generated. But when I decided to remove that code: In … | |
Re: Please try these links: [URL="http://www.java2s.com/Tutorial/CSharp/0080__Statement/Nestedforlooptocalculateprimenumber.htm"]http://www.java2s.com/Tutorial/CSharp/0080__Statement/Nestedforlooptocalculateprimenumber.htm[/URL] [URL="http://www.daniweb.com/forums/thread80255.html"]http://www.daniweb.com/forums/thread80255.html[/URL] | |
Re: Hi, Try like this: [CODE] OleDbConnection con=new OleDbConnection(@"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Documents and Settings\Shahan.COREI3\My Documents\DateRange.mdb"); OleDbCommand command = new OleDbCommand("select * from tbl1_order where StartDate between #" + dateTimePicker1.Value.ToString().Split(' ')[0] + "# and #" + dateTimePicker2.Value.ToString().Split(' ')[0] + "#"); con.Open(); command.Connection = con; OleDbDataAdapter da=new OleDbDataAdapter(command); DataSet ds=new DataSet("Dset"); da.Fill(ds); dataGridView1.DataSource =ds.Tables[0]; con.Close(); … |
The End.