5,346 Posted Topics
Re: [b]>2. How do I clear the data in the grid before executing the below codes.[/b] Set Nothing (null) [code] grdlocation.DataSource=Nothing [/code] | |
Re: Have a look at following code-snippet. [code] public class Test public shared Sub Foo() End Sub End Class [/code] Now, to call Foo() method. [code] Test.Foo() [/code] | |
Re: [code] dataview = dataset.Tables[Table_Name].DefaultView; dataview.RowFilter = "DATE>='" + startDate.ToShortDateString() + "' and DATE<='" + endDate.ToShortDateString()+ "'"; dataGridView1.DataSource = dataview; [/code] | |
Re: Welcome suzainform. We appreciate your help. Have you ever noticed that this thread is six years old? Please do not resurrect old/solved threads. Read member rules : [url]http://www.daniweb.com/forums/faq.php?faq=daniweb_policies[/url] [url]http://www.daniweb.com/forums/thread78223.html[/url] Thread Closed. | |
Re: [b]>I want to search for 2 items in the database and display then in the datagrid. [/b] You should have to change select query. [code] SELECT * FROM tblProperty WHERE tblProperty.County='Cork' or Country='Kerry' [/code] OR [code] SELECT * FROM tblProperty WHERE tblProperty.County IN ('Cork','Kerry') [/code] | |
Re: Please do not resurrect old/solved threads. If you want to ask question, start your own thread. Have a look at forum [URL="http://www.daniweb.com/forums/faq.php?faq=daniweb_policies"]rules[/URL]. Please read before posting - [url]http://www.daniweb.com/forums/thread78223.html[/url] Thread Closed. | |
Re: If [B]cost[/B] of product is stored in [B]TableProduct[/B] then you can retrieve using, [code] string sql = "SELECT * From TableProduct WHERE Product_Category = 1"; da = new SqlDataAdapter(sql, cs); ds.Clear(); da.Fill(ds,"Product"); cbChips.DataSource = ds.Tables["Product"]; cbChips.DisplayMember = "Product_Name"; cbChips.ValueMember = "cost"; [/code] | |
Re: [code] MAcmd.CommandText = "DELETE FROM EventTable " + "WHERE EventName = '" + cmbEventList.Text + "'"; [/code] Please do not resurrect old threads. If you want to ask question, start your own thread. Have a look at forum [URL="http://www.daniweb.com/forums/faq.php?faq=daniweb_policies"]rules[/URL]. Please read before posting - [url]http://www.daniweb.com/forums/thread78223.html[/url] | |
Re: Use Dictionary instead of array. [code] public partial class Form1 : Form { public Form1() { InitializeComponent(); } Dictionary<string, string[]> name; private void Form1_Load(object sender, EventArgs e) { name = new Dictionary<string, string[]>() { {"ManaUsers",new string[]{"Balance","Restoration","BeastMaster","Marksman","Survival","Fire","Frost","Arcane","Holy","Discipline","Shadow","Prot","Retribution","Elemental","Enhance","Affliction","Demonology","Destruction"}}, {"RageUsers",new string[]{"Arms", "Fury", "Protection", "Bearform" }}, {"NrgUsers",new string[] { "Assassination", "Combat", "Subtlety", "Catform" }}, … | |
Re: Have a look at following code. Mdiform - Form1.cs [code] public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void newToolStripMenuItem_Click(object sender, EventArgs e) { Form2 frm = new Form2(); frm.Text = "Untitled"; frm.MdiParent = this; frm.Show(); } private void saveToolStripMenuItem_Click(object sender, EventArgs e) { if … | |
Re: Welcome sachin kumar46. Have you ever noticed that the current thread is four years old? Please do not resurrect old/solved threads. If you want to ask question, start your own thread. Please read the rules before posting again - [url]http://www.daniweb.com/forums/thread78223.html[/url] and [URL="http://www.daniweb.com/forums/faq.php?faq=daniweb_policies"]rules[/URL]. Thread Closed. | |
Re: [b]>but i cannot add the reference to the System.Data.OracleClient like it is able in VS 2008.[/b] [URL="http://blogs.msdn.com/bclteam/archive/2008/05/21/net-framework-client-profile-justin-van-patten.aspx"].NET Framework Client Profile [/URL]- an interesting feature is added with vs2010. In order to work with Oracle provider you have to set target framework property to ".Net Framework 4" instead of ".Net Framework … | |
Re: Use [B]Checked[/B] property. [code] desDefaultCheckbox.Checked= grvDesignationList.Item(4, i).Value [/code] EDIT: Do not flood the forum by posting the same question more than once (ie in multiple forums). Read forum rules - [url]http://www.daniweb.com/forums/faq.php?faq=daniweb_policies[/url] | |
Re: [b]>I want to declare a integer variable in global scope[/b] You can store value with global scope. [code] protected void Page_Load(object sender, EventArgs e) { Application.Lock(); if(Application["key1"]==null) { Application["key1"]=10; } int n=(int)Application["key1"]; Application.Unlock(); } [/code] | |
Re: Take a look at : 1. [url]http://www.codeproject.com/KB/IP/AsyncSocketServerandClien.aspx[/url] 2. [url]http://www.codeproject.com/KB/IP/socketsincs.aspx[/url] 2. [url]http://msdn.microsoft.com/en-us/library/fx6588te.aspx[/url] | |
Re: TagLib-Sharp.com no longer exists but it is still alive and kicking under the umbrella of the Banshee Project. Links: [url]http://kerrick.wordpress.com/category/taglib/[/url] [url]http://gburt.blogspot.com/2010/03/banshee-16.html[/url] [url]http://banshee-project.org/support/guide/audio-cds/[/url] | |
Re: Render drawing in a thread separately. [code] private void btnDraw_Click(object sender, EventArgs e) { //check which among the draw options are selected & for any combination of options randomly call the appropriate draw functions. if (cbLines.Checked == true && cbOvals.Checked == true && cbRectangles.Checked == true) { System.Threading.Thread t=new System.Threading.Thread(()=>{ … | |
Re: Have a look at - [url]http://htmlagilitypack.codeplex.com/wikipage?title=Examples&referringTitle=Home[/url] | |
Re: [b]>if I use it in access it..its not working. Any idea why?[/b] [code=text] Select Lastname from employees where Firstname Like '%S%'; [/code] | |
Re: Have a look at - [url]http://msdn.microsoft.com/en-us/library/bb756992.aspx[/url] | |
Re: [b]>and it says 'no value given for one or more required parameters[/b] Verify columns and table name in your database. | |
Re: [b]>I want to auto update the third column that if I delete the value of one of first two columns the third column will be affected.[/b] Expression column. [code] Dim dt As New Data.DataTable dt.Columns.Add("No1", GetType(Int32)) dt.Columns.Add("No2", GetType(Int32)) dt.Columns.Add("Sum", GetType(Int32), "No1+No2") datagridView1.DataSource = dt [/code] | |
Re: Suggestion: Use BinaryReader and BinaryWriter. | |
Re: [b]>Object reference not set to an instance of an object.[/b] Error says that the object variable has null/nothing in it. To avoid such a problem check/verify the existence of object using IsNothing() method. [code] Dim Ds as DataSet if IsNothing(ds) Then Ds=new DataSet() End IF [/code] Please show us where … | |
Re: Please show your code work. | |
Re: Have a look at - [url]http://en.csharp-online.net/Deploying_Windows_Applications%E2%80%94Prerequisites[/url] | |
Re: Please do not resurrect old threads. If you want to ask question, start your own thread. Read forum rules : [url]http://www.daniweb.com/forums/faq.php?faq=daniweb_policies[/url] [url]http://www.daniweb.com/forums/thread78223.html[/url] Thread Closed. | |
Re: [b]>i would like to link it to visual basic 6[/b] [b][URL="http://msdn.microsoft.com/en-us/library/4zey12w5%28VS.71%29.aspx"]Declare[/URL][/b] statement will allow you to import functions from [URL="http://forums.devx.com/archive/index.php/t-76329.html"]DLL[/URL]. | |
Re: [b]>but after that last line wb.Url is always null.[/b] That's true. It will remains null till document is not completely rendered. [code] private void button1_Click(object sender, EventArgs e) { webBrowser1.Url = new Uri("http://en.wikipedia.org/wiki/Earth"); webBrowser1.DocumentCompleted += new WebBrowserDocumentCompletedEventHandler(webBrowser1_DocumentCompleted); } void webBrowser1_DocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e) { MessageBox.Show(webBrowser1.Url.ToString()); } [/code] | |
Re: [b]>i dont know how to solve this... can any one help....!? [/b] You need to terminate previous instance of your application before running a new one. [code] Application.Exit(); [/code] | |
Re: You can set the [B]EnableRaisingEvents[/B] property on the Process instance to true, and then subscribe to the [B]Exited [/B] event. | |
Re: Please read [url]http://support.microsoft.com/kb/315529[/url] | |
Re: Hi, Please do not resurrect old threads. Take a look at forum rules , http://www.daniweb.com/forums/thread78223.html Thread Closed. | |
Re: Have a look at - Exception handling best practices in [URL="http://searchsqlserver.techtarget.com/tip/Exception-handling-best-practices-in-SQL-Server-2005"]SQL Server[/URL] 2005 | |
Re: Please have a look at these two threads: 1. [url]http://stackoverflow.com/questions/1661330/read-information-from-a-serial-port-in-vb-net-2008[/url] 2. [url]http://stackoverflow.com/questions/496415/error-opening-serial-port[/url] | |
Re: [code] DataCommand.CommandText = "SELECT MemberNumber FROM MembersProgramDetails WHERE Username='" & username & "' AND Password='" & password & "'" [/code] | |
Re: [b]>all the applications are published to a public server, and each user on the network launches them from the public server..[/b] It means a user can download an application. Isn't it? [b]>anyone have an idea as to why this might be causing issues?[/b] Maybe lack of run time environment. | |
Re: Do not instantiate the CommandBuilder in each & every event/action. [code] Imports System.Data Public Class Borrower Dim inc As Integer Dim MaxRows As Integer Dim ds As New DataSet Dim da As OleDb.OleDbDataAdapter Dim sql As String Dim cb As OleDb.OleDbCommandBuilder Private Sub Borrower_Load(ByVal sender As System.Object, ByVal e As … | |
Re: Try it, [code] Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load ComboBox1.DataSource = GetTable("select st_uid,st_name from state") ComboBox1.DisplayMember = "st_name" ComboBox1.ValueMember = "st_uid" End Sub Public Function GetTable(ByVal query As String) As System.Data.DataTable Dim adp As New OleDb.OleDbDataAdapter(query, "put_connection_string_here") Dim dt As New Data.DataTable adp.Fill(dt) Return … | |
Re: Handle cellpainting event of datagridview. [code] Private Sub DataGridView1_CellPainting(ByVal sender As System.Object, ByVal e As System.Windows.Forms.DataGridViewCellPaintingEventArgs) Handles DataGridView1.CellPainting If e.ColumnIndex < 0 AndAlso e.RowIndex >= 0 Then e.PaintBackground(e.ClipBounds, True) e.Graphics.DrawImage(Image.FromFile("file.png"), e.CellBounds) e.Handled = True End If End Sub [/code] | |
Re: [b]>the DateTimePicker stuck my form[/b] Sorry, I'm not quite following the problem. Can you point out where you got problems while running a code? | |
Re: [b]>.In the sixth cell, i want a check box to be displayed[/b] The sixth cell should be templated column. | |
Re: [b]>How to know what is last index number in a drop down list if it is populated by using database?? [/b] No need to worry about the size (capacity) because DropDownList uses List collection. You can use [B]Count[/B] property of items collection to get the last index = (Count -1) | |
Re: You can use BackgroundWork, [code] Dim dlg As Form Dim pgr As ProgressBar Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click BackgroundWorker1.WorkerReportsProgress = True dlg = New Form() pgr = New ProgressBar pgr.Dock = DockStyle.Fill pgr.Minimum = 1 pgr.Maximum = 100 dlg.Owner = Me dlg.Size = … | |
Re: [b]>how to display certain data from database using drop down list in the grid view [/b] Which database product are you using? Please show us your code work. | |
Re: See this [URL="http://stackoverflow.com/questions/1158099/why-does-authenticating-against-ldap-with-directoryentry-intermittently-throw-com"]thread.[/URL] | |
Re: [b]>i have to bind menu controler to database at run time , but i have no idea of data Relation.[/b] No problem. Fetch one after one row from the table. | |
Re: Use Parameters. [code] String query = @"Insert Into Action (Description,AssignedTo,DueDate,Status,DateCompleted,Comment) values ("@p1,@p2,@p3,@p4,@p5,@p6)" SqlCommand command = new SqlCommand(query, DB.getConnection()); command.Parameters.Add("@p1",SqlDbType.Varchar,40) command.Parameters.Add("@p2",SqlDbType.Varchar,20) command.Parameters.Add("@p3",SqlDbType.DateTime,8) command.Parameters.Add("@p4",SqlDbType.Varchar,10) command.Parameters.Add("@p5",SqlDbType.DateTime,8) command.Parameters.Add("@p6",SqlDbType.Varchar,100) db.openConnection(); for (k = 0; k < (countRow - 1); k++) { for (j = 0; j < (countCol); j++) { command.Parameters(j).Value=dgvAList[j, k].Value; } command.ExecuteNonQuery(); } … | |
Re: You have to bind "SelectedItem" [code] .. ComboBox1.DataSource = [Enum].GetValues(GetType(Customer.ChildGroup)) ComboBox1.DropDownStyle = ComboBoxStyle.DropDownList BindingSource1.DataSource = Customer NumericUpDown1.Minimum = 0 NumericUpDown1.Maximum = 10000 NumericUpDown1.DataBindings.Add( _ New Windows.Forms.Binding("Value", BindingSource1, "Id", False, DataSourceUpdateMode.OnPropertyChanged)) TextBox1.DataBindings.Add( _ New Windows.Forms.Binding("Text", BindingSource1, "Name", False, DataSourceUpdateMode.OnPropertyChanged)) ComboBox1.DataBindings.Add( _ New Windows.Forms.Binding("SelectedItem", BindingSource1, "Child", False, DataSourceUpdateMode.OnPropertyChanged)) .. [/code] |
The End.