Thanks. This is very good one. Just to mention one thing here. Its changes all the rows with new value "America". I want to updates the same cell where was cliked. Once Again Thanks
dwark106
Posts
-
How to change the button's value in Datagrid -
How to change the button's value in DatagridHi Everyone, I am using button's obj in datagridview and set the flag as true to show the text value of the button (Name of the Button). If user clicks on the button, its changes the button’s name based upon the criteria. I am doing very simple code here. I set button’s name as “buttonColumn.UseColumnTextForButtonValue = true;” Now If I want to change the value with following settings. It did not work it out. dataGridView1[e.ColumnIndex, e.RowIndex].Value = "America"; It is still taking "Name" Can you please help me on this? private void CreateButtonColumn() { // Initialize the button column. DataGridViewButtonColumn buttonColumn = new DataGridViewButtonColumn(); // Add the button column to the control. buttonColumn = new DataGridViewButtonColumn(); buttonColumn.Name = "Name"; buttonColumn.Text = "Name"; buttonColumn.Width = 110; buttonColumn.UseColumnTextForButtonValue = true; dataGridView1.Columns.Insert(0, buttonColumn); dataGridView1.Rows.Add(2); dataGridView1.CellClick += new DataGridViewCellEventHandler(dataGridView1_CellClick); } void dataGridView1_CellClick(object sender, DataGridViewCellEventArgs e) { if (Convert.ToInt32(e.ColumnIndex) == 0) { dataGridView1[e.ColumnIndex, e.RowIndex].Value = "America"; } } Thanks.
-
How to add table's content from one to another tableBasically, I have xml format table that's why I am using two table( I guess so)
-
How to add table's content from one to another tableI am using two tables because one for displaying the contents of the selected row in Displaytable when user send data through text box and other one is used for maintable (getting the data for displaytable). I donot have any problem to use one table but I donot know how to use and display the contents of the selected 10 row. If user modify one row or delete how to update the maintable.
-
How to add table's content from one to another tableHi All, I have a table which has multiple row. User wants to see some data based upon criteria(Primary Key) through user interface. After displaying the row on the datagrid(Infragistic), user wants to delete some rows or update. In my code, I am using two table. One is "Maintable" and other is "Displaytable". I donot have any problem to display the row using "Displaytable" in datagrid but when user update or delete rows and I donot know how to update the "maintable". Do I need to have only one table or two table? Please help me. Thanks in Advance
-
How to convert OCX file into C#Hi Pallini, Thanks for your response. 1. Actually I donot know what are the functions are being used by this application(ocx). I am also thinking to write from the scratch, but I do not have source code, so that I can chop the function that is not needed. 2. I was looking the easier way to convert the application. Anyways I will take your suggestions.
-
How to convert OCX file into C#Hi Everyone, I have a project which was written long time back. Now we are in position to convert into C# source code but we found that we donot have any source code. I need two favors from you. 1. How to convert the ocx file into C# source code without having the source code 2. How to convert VC++ source code into C# soruce code. Thanks in advance
-
Only one usage of each socket address (protocol/network address/port) is normally permittedThanks for all. Yes I fixed it. Now it is running. Thanks a lot. -- modified at 13:29 Sunday 8th January, 2006
-
Only one usage of each socket address (protocol/network address/port) is normally permittedHi All, I have a problem in C# Remoting. I am doing as given below code. I am also giving different Computername and Portname. Every time m_DisplayComputerName and m_lDisplayPort read from the Database. But Still I am getting error. "Only one usage of each socket address (protocol/network address/port) is normally permitted" //This is client and connection() funtion in Constructor private void Connection() { try { // First check if a Channel with the computername already exists. IChannel oChannel = ChannelServices.GetChannel(m_DisplayComputerName); if (oChannel == null) { // then we need to create. IDictionary props = new Hashtable(); props["name"] = m_DisplayComputerName; props["port"] = m_lDisplayPort; BinaryClientFormatterSinkProvider clientSink = new BinaryClientFormatterSinkProvider(); BinaryServerFormatterSinkProvider serverSink = new BinaryServerFormatterSinkProvider(); oChannel = new TcpChannel(props,clientSink,serverSink); //oChannel = new TcpChannel(props,null,null); ChannelServices.RegisterChannel(oChannel); } /*else { // do nothing }*/ } catch(System.Net.Sockets.SocketException ex) { MessageBox.Show(ex.Message); } m_remoting = (RFDisplayStation_Remoting_Interface.IRFDisplaystation_Remoting_Interface)Activator.GetObject( typeof(RFDisplayStation_Remoting_Interface.IRFDisplaystation_Remoting_Interface), GetURL()); } private string GetURL() { return "Tcp://" + m_DisplayComputerName + ":" + m_lDisplayPort + "/RemotingKeyWord"; } ///////Server side And also in Constructor try { ChannelServices.RegisterChannel(new TcpChannel((int)(m_ResourceDetailsArray[0].DisplayPort))); } catch(System.Net.Sockets.SocketException ex) { MessageBox.Show(ex.Message); } Thanks -- modified at 21:14 Saturday 7th January, 2006
-
How to Use satallite AssemblyHi Everyone, I am making an application for language specification and using satallite assembly. If we use satallite assembly means there is no need to recompilation of application. What I am doing that is given below step by step. 1. Created file like string.txt,string.de-DE.txt,string.ja.txt 2. compile all txt file with "resgen.exe" at command prompt like "resgen string.de-DE.txt string.de-DE.resources. 3. Again compile all resources file with "al.exe" like "al /t:lib /embed:strings.de-DE.resources /culture:de /out:myApp.resources.dll" 4. Created folder in my application for different language specification like "de-DE","ja"(Folder name) 5. Put file in this folder like for "de-DE" folder for myApp.resources.dll,string.de-DE.resources,string.de-DE.txt 6. In coding part "myapp.cs" a) //static ResourceManager rm = new ResourceManager("myapp.string", Assembly.GetExecutingAssembly());//myapp is "namespace" static ResourceManager rm = new ResourceManager("myapp.string",(typeof(Class1).Assembly));//string is "base name" b) cultureinfo and switch case 7. Question is that if i don't make these resource file as satallite assembly then it works fine but if i make these resource file as satallite assembly and put the resource file and dll in folder then it doesn't work. 8. If i run this application it pick up default one english language specification but not pick up german or any other language. 9. I am following each step that is given in MSDN. Thanks
-
How to Use DropDownList in ASP.NETThanks for your help. bool SelectedItemCombo. Actually I have ready made this program in C#(winform) So where I used it. Once I remove it from my program in ASP.NEt it is working fine. Once again Thanks.
-
How to Use DropDownList in ASP.NETThanks for solving my one problem. But I am still facing problem. If I select company name from Dropdownlist it does not showing me corresponding record on the textbox(like customer name,address,phone number and so on. protected void DropDownList1_SelectedIndexChanged(object sender, System.EventArgs e) { if(this.SelectedItemCombo) { DetailsOfRecords(); } } protected void DetailsOfRecords() { thisConnection.Open(); thisCommand = thisConnection.CreateCommand(); thisCommand.CommandText = " SELECT * from Customers where CustomerID=" + this.DropDownList1.SelectedValue; thisReader = thisCommand.ExecuteReader(); while(thisReader.Read()) { string strID = thisReader["CustomerID"].ToString(); if(strID == this.DropDownList1.SelectedValue.ToString()) { this.txtCustomerName.Text = thisReader["CustomerName"].ToString(); this.txtCompany.Text = thisReader["Company"].ToString(); this.txtEmailAddress.Text = thisReader["Email"].ToString(); } } }
-
How to Use DropDownList in ASP.NETHi Everyone, I am facing a problem while using DropDownList. Actually I am retrieveing company name from Sql server and displaying on DropDownList (value + id). If I select DropDownList(just like combo box), it displays me 1st records corresponding to that record(ID). But if I click 2nd,3rd and fourth and so on from DropDownList company name , every time it displays me only 1st record on textbox. //////////////This is server side program(Update.aspx)////////////// <%@ Page language="c#" Codebehind="Update.aspx.cs" AutoEventWireup="false" Inherits="Myprogram.Update" %>
Select Company Name:
asp:DropDownList id="DropDownList1" AutoPostBack="True" OnSelectedIndexChanged="DropDownList1_SelectedIndexChanged" runat="server" Width="160px" Height="16px" DataTextField="Display" DataValueField="Value"> /asp:DropDownList>
Customer Name:
/////////Update.aspx.cs//////////// protected void DropDownList1_SelectedIndexChanged(object sender, System.EventArgs e) { if(this.SelectedItemCombo) { DetailsOfRecords(); } } protected void DetailsOfRecords() { thisConnection.Open(); thisCommand = thisConnection.CreateCommand(); thisCommand.CommandText = " SELECT * from Customers where CustomerID=" + this.DropDownList1.SelectedValue.ToString(); thisReader = thisCommand.ExecuteReader(); while(thisReader.Read()) { string strID = thisReader["CustomerID"].ToString(); if(strID == this.DropDownList1.SelectedValue.ToString()) { this.txtCustomerName.Text = thisReader["CustomerName"].ToString(); this.txtCompany.Text = thisReader["Company"].ToString(); } } thisReader.Close(); thisConnection.Close(); }
-
How to connect ASP.Net With SQL ServerIf I remove this "Integrated Security=SSPI;" from connecting string then It is working fine. Thanks a lot for your kind help.
-
How to connect ASP.Net With SQL ServerThanks for your mail. I am doing like this string myConnectionString = "Initial Catalog=MyDB;Data Source=localhost;Integrated Security=SSPI;server=ComputerName\\MY2000;user id=sa; Password="; My password is blank. I am not using windows authentication. It is working without using ASP.NET.
-
How to connect ASP.Net With SQL ServerI am new of ASP.Net and facing a problem that whenever I do connection ASP.Net with Sql Server it gives me error "Login failed for user 'ComputerName\ASPNET'. Exception Details: System.Data.SqlClient.SqlException: Login failed for user 'ComputerName\ASPNET'. Line 78: thisAdapter.Fill(thisDataSet,"Customers"); I am doing like this " string myConnectionString = "Initial Catalog=Northwind;Data Source=localhost;Integrated Security=SSPI;server=ComputerName\\MY2000"; thisConnection = new SqlConnection(myConnectionString); and so on. It is working fine in windows form. Thanks
-
How to open a form when click on Datagrid in C#Thanks a lot
-
How to open a form when click on Datagrid in C#Hi Everybody, How to open a new form when click on row of Datagrid in C#. Thanks
-
How to Update a row in DatagridHi Everyone, Again I am posting my problem. I am working on DataGrid. Actually I have relationship between two table(Customers and orders) and displaying on DataGrid. I want to update a record of orders table when I click or select on one datagrid row, all the records of one row (order table) goes to Textbox control one by one then I or user can update the table easily. Actually then I will have orderID in textbox control. Thanks
-
How to Update a row of DatagridHi Everyone, I am working on DataGrid. Actually I have relationship between two table(Customers and orders) and displaying on DataGrid. I want to update a record of orders table when I click or select on datagrid, all the records of order table goes to Textbox control one by one then I or user can update the table easily. Thanks