or use Microsoft Enterprise Library's Data Access Block :) Maqsood Ahmed - MCAD.net Kolachi Advanced Technologies http://www.kolachi.net
Maqsood Ahmed
Posts
-
ADO.Net and OOP -
Help with GridViewHello, I am new to ASP.net 2.0. I have successfully bound a in-memory
DataTable
(not connected with a database) withGridView
. I have setAutoGenerateEditButton
property totrue
. Now whenever i click on Edit link, the page does postback, but the row does not become editable. I have also triedGridView1.Rows[e.NewEditIndex].RowState = DataControlRowState.Edit;
in RowEditing event handler. Am I missing something? Thanks in advance. Maqsood Ahmed - MCAD.net Kolachi Advanced Technologies http://www.kolachi.net -
Help regarding DataGridHello, This is because the new row has not been committed in the datatable/datasource which you are using with DataGrid. You can write code in CurrentCellChanged event handler to assure that the changes you made in the datagrid are saved when you leave the cell. HTH. Cheers. Maqsood Ahmed - MCAD.net Kolachi Advanced Technologies http://www.kolachi.net
-
Base Class or common static method?Hello, In my opinion, making a class for each table is not an optimal solution because a database might contain alot of tables, and it can expand also, which will increase the implementation cost and It may also result in code replication. If generic methods for Addition, Update, Deletion and retrieval are deviced then it won't affect much as far as implementation is concerned. Developers will only need to add functionality to use newly added tables where ever it is required without implementing new classes for each table. What you think? Maqsood Ahmed - MCAD.net Kolachi Advanced Technologies http://www.kolachi.net
-
Base Class or common static method?Hello, Why not use static overloaded methods from a class say "DatabaseHelperClass"?
GetRows(string key,string value, string tableName) GetRows(Hashtable filter,string tableName) GetRows(string tableName)
and same for other tasks??? As far as additions/updates are concerned, you can put the values in a hashtable such that the Key represents the column name and value represents the value of the column you want to add or update in the table. with respect to the key.. For AdditionsAddRow(string tableName,Hashtable values)
For UpdatesUpdateRows(string key, string value, string tableName, Hashtable values) GetRows(Hashtable filter,string tableName, Hashtable values) UpdateRows(string tableName, Hashtable values)
you can do similar for deletions as well. Don't you think it will be a clean approach? Maqsood Ahmed - MCAD.net Kolachi Advanced Technologies http://www.kolachi.net -
Dispose in FormsHello, Try to use
FormClosing
event (.net 2.0) of the form. HTH. Cheers. Maqsood Ahmed - MCAD.net Kolachi Advanced Technologies http://www.kolachi.net -
Quick DaaView QuestionHello, You can set
DataView.RowFilter
property tostring.Empty
to view all records in the table.RowFilter
property is used to filter the records. You can usingSort
property ofDataView
to sort the data. HTH. Cheers. Maqsood Ahmed - MCAD.net Kolachi Advanced Technologies http://www.kolachi.net -
Get this compile error "Could not copy temporary files to the output directory."Hello, Please check that the dll file is being used by an running .exe file. close the application and try to build it. It should work. HTH. Cheers :) Maqsood Ahmed - MCAD.net Kolachi Advanced Technologies http://www.kolachi.net
-
Need a Text Editor .dll with MS Word ToolBars for Win Forms!!!Hello, You can have this [^]for a start. HTH. Cheers :) Maqsood Ahmed - MCAD.net Kolachi Advanced Technologies http://www.kolachi.net
-
Need a Text Editor .dll with MS Word ToolBars for Win Forms!!!Hello, What exactly is your requirement? A rich text editor or Toolbars like MS Word? Maqsood Ahmed - MCAD.net Kolachi Advanced Technologies http://www.kolachi.net
-
Hibetnateing computer in vb.netHello, this is C# version of the code:
[DllImport( "powrprof.dll", EntryPoint="SetSuspendState", CharSet=CharSet.Ansi)] private static extern int SetSuspendState(int Hibernate, int ForceCritical, int DisableWakeEvent);
you should call it like this:SetSuspendState(1,0,0);
I found this information here Maqsood Ahmed - MCAD.net Kolachi Advanced Technologies http://www.kolachi.net -
Help Me with "Directory"Hello, Use
DirectoryInfo
class'sAttributes
property. HTH, Cheers :) Maqsood Ahmed - MCAD.net Kolachi Advanced Technologies http://www.kolachi.net -
DataGird Can U help MeHello, Use DataGridBoolColumn for boolean columns by checking their DataType property HTH. Cheers. Maqsood Ahmed - MCAD.net Kolachi Advanced Technologies http://www.kolachi.net
-
Customize ToolbarHello, Had anyone tried to use
TB_CUSTOMIZE
message with WinForm toolbars. I have usedSendMessage
to display toolbar customization window but it just didn't help. Any suggestion/links will be appretiated. Thanks in advance. Maqsood Ahmed - MCAD.net Kolachi Advanced Technologies http://www.kolachi.net -
Get full SOAP messageHello, Have a look at SoapExtension class in MSDN. Also see this HTH. Cheers :) Maqsood Ahmed - MCAD.net Kolachi Advanced Technologies http://www.kolachi.net
-
disabling column resizing in Data gridHello, You will have to inherit from the DataGrid control and override it OnMouseDown protected method. You can do it like this:
protected override void OnMouseDown(MouseEventArgs e) { try { Point downPoint = new Point(e.X,e.Y); DataGrid.HitTestInfo hitInfo = this.HitTest(downPoint); switch(hitInfo.Type) { case DataGrid.HitTestType.ColumnResize: break; default: base.OnMouseDown(e); break; } } catch(Exception ex) { Console.WriteLine(ex); } }
Maqsood Ahmed - MCAD.net Kolachi Advanced Technologies http://www.kolachi.net -
NumericUpDownHello, I am trying to find out a way to know that the user has changed value in NumericUpDown control by typing in it or by pressing the up or down buttons. Any suggestions about it? Thanks in Advance. Maqsood Ahmed - MCAD.net Kolachi Advanced Technologies http://www.kolachi.net
-
How to insert a new column in anywhere of DataSet?Hello, You can add columns sequentially. You can use DataGridTableStyles for displaying column in whatever sequence you want. HTH. Cheers. Maqsood Ahmed - MCAD.net Kolachi Advanced Technologies http://www.kolachi.net
-
How to insert a new column in anywhere of DataSet?Hello, First of all you can not add column in a
DataSet
. You can do it in aDataTable
. Can you explain why do you want to insert column at a specified index? Maqsood Ahmed - MCAD.net Kolachi Advanced Technologies http://www.kolachi.net -
[Message Deleted]Hello, You can get the CurrencyManager and access its Count property.
CurrencyManager cm = dataGrid.BindingContext[dataGrid.DataSource] as CurrencyManager; if(cm != null) int count = cm.List.Count; //Total rows in the grid.
HTH. Cheers :) Maqsood Ahmed - MCAD.net Kolachi Advanced Technologies http://www.kolachi.net