5,346 Posted Topics

Member Avatar for krahuman

[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]

Member Avatar for kvprajapati
0
116
Member Avatar for Phoenix127

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]

Member Avatar for Phoenix127
0
903
Member Avatar for Syeda.farwa

[code] dataview = dataset.Tables[Table_Name].DefaultView; dataview.RowFilter = "DATE>='" + startDate.ToShortDateString() + "' and DATE<='" + endDate.ToShortDateString()+ "'"; dataGridView1.DataSource = dataview; [/code]

Member Avatar for Syeda.farwa
0
133
Member Avatar for Slade

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.

Member Avatar for kvprajapati
0
3K
Member Avatar for kieran82

[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]

Member Avatar for kvprajapati
0
845
Member Avatar for Kids

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.

Member Avatar for kvprajapati
0
1K
Member Avatar for SGstudent2010

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]

Member Avatar for kvprajapati
1
135
Member Avatar for Geodude0487

[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]

Member Avatar for kvprajapati
0
164
Member Avatar for mbrodie

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" }}, …

Member Avatar for kvprajapati
0
170
Member Avatar for bravo659

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 …

Member Avatar for kvprajapati
0
860
Member Avatar for am_dumb

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.

Member Avatar for kvprajapati
1
179
Member Avatar for jellybeannn
Member Avatar for severman

[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 …

Member Avatar for kvprajapati
0
451
Member Avatar for tashiDuks

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]

Member Avatar for kvprajapati
0
489
Member Avatar for ans2007kumar

[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]

Member Avatar for rohand
0
135
Member Avatar for Gospp

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]

Member Avatar for Gospp
0
102
Member Avatar for Chrisjj

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]

Member Avatar for Chrisjj
0
105
Member Avatar for songweaver

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(()=>{ …

Member Avatar for kvprajapati
0
183
Member Avatar for csharp12

Have a look at - [url]http://htmlagilitypack.codeplex.com/wikipage?title=Examples&referringTitle=Home[/url]

Member Avatar for kvprajapati
0
81
Member Avatar for sweetypie123

[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]

Member Avatar for sweetypie123
0
136
Member Avatar for adino2

Have a look at - [url]http://msdn.microsoft.com/en-us/library/bb756992.aspx[/url]

Member Avatar for kvprajapati
0
53
Member Avatar for Ednt

[b]>and it says 'no value given for one or more required parameters[/b] Verify columns and table name in your database.

Member Avatar for kvprajapati
0
108
Member Avatar for kedakai

[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]

Member Avatar for kvprajapati
0
103
Member Avatar for pcchamp
Member Avatar for KadajXII

[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 …

Member Avatar for KadajXII
0
96
Member Avatar for tukky
Member Avatar for thanlin

Have a look at - [url]http://en.csharp-online.net/Deploying_Windows_Applications%E2%80%94Prerequisites[/url]

Member Avatar for Luc001
0
78
Member Avatar for mickeyfitzray

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.

Member Avatar for kvprajapati
0
367
Member Avatar for prade

[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].

Member Avatar for kvprajapati
0
282
Member Avatar for tyler_kid_a

[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]

Member Avatar for kvprajapati
2
188
Member Avatar for loliana

[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]

Member Avatar for kvprajapati
0
82
Member Avatar for mamutu

You can set the [B]EnableRaisingEvents[/B] property on the Process instance to true, and then subscribe to the [B]Exited [/B] event.

Member Avatar for kvprajapati
1
171
Member Avatar for ChinnaG
Member Avatar for kvprajapati
0
41
Member Avatar for skymonster84

Hi, Please do not resurrect old threads. Take a look at forum rules , http://www.daniweb.com/forums/thread78223.html Thread Closed.

Member Avatar for kvprajapati
0
156
Member Avatar for verbalurbs

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

Member Avatar for verbalurbs
0
91
Member Avatar for deeaz_luv

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]

Member Avatar for deeaz_luv
0
2K
Member Avatar for rmontgomery

[code] DataCommand.CommandText = "SELECT MemberNumber FROM MembersProgramDetails WHERE Username='" & username & "' AND Password='" & password & "'" [/code]

Member Avatar for rmontgomery
1
89
Member Avatar for jlego

[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.

Member Avatar for jlego
0
94
Member Avatar for stacyann

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 …

Member Avatar for SolutionExpert
0
339
Member Avatar for Aleksandor51

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 …

Member Avatar for Aleksandor51
0
388
Member Avatar for dre-logics

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]

Member Avatar for dre-logics
0
1K
Member Avatar for addilla

[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?

Member Avatar for addilla
0
158
Member Avatar for mandi009

[b]>.In the sixth cell, i want a check box to be displayed[/b] The sixth cell should be templated column.

Member Avatar for mandi009
0
75
Member Avatar for ans2007kumar

[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)

Member Avatar for Ramesh S
0
67
Member Avatar for dre-logics

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 = …

Member Avatar for dre-logics
0
100
Member Avatar for maria_mj

[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.

Member Avatar for kvprajapati
0
307
Member Avatar for sanbal

See this [URL="http://stackoverflow.com/questions/1158099/why-does-authenticating-against-ldap-with-directoryentry-intermittently-throw-com"]thread.[/URL]

Member Avatar for kvprajapati
0
356
Member Avatar for rajesh_tit

[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.

Member Avatar for kvprajapati
0
57
Member Avatar for krishnisilva

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(); } …

Member Avatar for kvprajapati
0
143
Member Avatar for kmh72756

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]

Member Avatar for kvprajapati
0
124

The End.