|
hi,
You wrote
When the user clicks the Insert button, I want to add a new row with values entered by the user.
In your button click you can do this much things.
1. check alll validations.
2. create a datarow of your datatable.
3. assign the input values to proper data column .
4. add this new row to your datatable.
5. Update using dataadapter.
**************************
S r e e j i t h N a i r
**************************
|
|
|
|
|
Does anybody know how to pass a parameter from one user control to another user control on the same web form?
Please give this some consideration as it does not appear as simple as passing a paramter from a user control to the web form directly.
Thanks,
Bill
|
|
|
|
|
|
Hiya I have created an installer for my c# and ado.net app, but want to create a new sql table when the installer runs, if the sql table in the database does not exist.
I also need to add assemblies to the gac when the installer runs.
How do I do this??
Thanks.
|
|
|
|
|
|
I wrote my own installer, which just calls the various steps of installation in turn ( install .NET1.1, DirectX9, MSDE, etc. ) and one of those steps is a little app I wrote that uses an XML config file to specify a connection string and a sequence of .SQL files. The files it points to are the ones I used when writing the database, and the app runs them in turn, and displays any errors, and the SQL it is calling as it goes. This sets up my database, and then I run the installer for my actual applications.
Christian
I have drunk the cool-aid and found it wan and bitter. - Chris Maunder
|
|
|
|
|
Hi I now have my sql script which generates the database and tables.
I have my setup project and added a custom action for the script.
But the script will not run when being installed..
Help!!
|
|
|
|
|
I wrote my OWN installer, and run the script myself, that is, I also wrote the C# code to run the script. If you're not running your own code, I have no idea how to get an installer to run a SQL script, but I doubt just providing the script will do it.
Christian
I have drunk the cool-aid and found it wan and bitter. - Chris Maunder
|
|
|
|
|
Settings -> System -> Memory -> Running Programs
|
|
|
|
|
I am working on a product where depending on some metadata associated with a table column my presentation of the table contents changes. For example a user may say a column is bold and in the reports it should be printed bold.
If the table schema is fixed I could have done this by maintaining another table which maps a column with its display attributes. Problem with this scheme is both my table structure and the display attributes are user configurable.
So I think the best solution will be if I could make use of any built in database functionality to store the metadata. For example MS SQL Server has a description associated with each table column, which I can (hopefully) manipulate programmatically.
I would like to know is there a universal way to store and retrieve metadata about a database table column?
|
|
|
|
|
I work on a C# client-server product, which transfers big (100 to 1000MB) files over sockets amongst other things. For security reasons I can not use trivial ways like folder sharing, ftp etc between the two machines. A firewall blocks all ports except my own. So I have to transfer the files over my own socket code.
But I observe that the standard C# Socket class performs not so well if I consider file transfer speeds using FTP or ODBC BLOB row transfers. I have implemented it according to the MSDN sample. Can some one show me the optimal way to transfer files on sockets in C#?
Salil
|
|
|
|
|
I want to export a list of property names and the contents of those properties of a class at runtime. The trick is that don't know the class type at design time, nor can I edit the classes, it's a webservice running on a local server. I want to save
this list to a file.possibly XML document?
Please help
All knows
|
|
|
|
|
minity wrote:
The trick is that don't know the class type at design time, nor can I edit the classes
If you have the current executing assembly, call GetTypes() on your assembly to return a Type []. That should get you started.
- Nick Parker My Blog | My Articles
|
|
|
|
|
Hi all,
My application needs me to create a CSLID in the registry, in order for it to work! I usually do this manually by editing the registry.
I'd like the application to do this automatically by itself. I want it to automatically create a new CSLID under the key: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\
CurrentVersion\Explorer\Browser Helper Objects in the registry.
How would i code this in C# ???
Any help would be much appreciated, code examples or reference sites.
Thanx
|
|
|
|
|
Look at the Microsoft.Win32.Registry class. This has all the functionality you need to create keys and modify them.
BRCKCC
|
|
|
|
|
(1) See the MSDN documentation on Uuidgen.exe fo learning how you can geneate a GU/UU/CLS ID.
(2) Here is the code to put it in registry
a. Create the key hierarchy using this code
public void CheckRegistryKey(string sKeyname)
{
RegistryKey oRegistryKey = Registry.LocalMachine.OpenSubKey("SOFTWARE\\" + sKeyname, true);
if(oRegistryKey==null)
{
oRegistryKey = Microsoft.Win32.Registry.LocalMachine.OpenSubKey("SOFTWARE", true);
oRegistryKey.CreateSubKey(sKeyname);
}
}
b. Set the string clsid value using this
public void SetStringValue(string sKeyname, string sValueName, string sValue)
{
RegistryKey oRegistryKey = Registry.LocalMachine.OpenSubKey("SOFTWARE\\" + sKeyname, true);
if(oRegistryKey==null)
{
oRegistryKey = Microsoft.Win32.Registry.LocalMachine.OpenSubKey("SOFTWARE", true);
oRegistryKey.CreateSubKey(sKeyname);
}
oRegistryKey.SetValue(sValueName, sValue);
}
|
|
|
|
|
Hi,
I have a C# application, with a property "Windowhandler" of type IntPtr.
This is a window handler of a (managed) control contained by another .NET application that is running.
Now I need to retrieve that control's name and type.
Does anyone can point me in the right direction on how this can be done?
Thanks,
Kind regards,
Ludwig
|
|
|
|
|
Is it possible to use a RowFilter on two fields??
ex: dataView.RowFilter = "Job ='7777' and status = '1'", or something like that.
I can't find anything that works.
thnxs,
|
|
|
|
|
hi,
check property builder
**************************
S r e e j i t h N a i r
**************************
|
|
|
|
|
Hi,
i've picked up this code (on syncfusion.com) to autosize the heights of a datagrid row.
<br />
public void AutoSizeGrid(DataGrid gridTasks) <br />
<br />
{ <br />
int numRows = ((DataTable)gridTasks.DataSource).Rows.Count; <br />
Graphics g = Graphics.FromHwnd(gridTasks.Handle); <br />
StringFormat sf = new StringFormat(StringFormat.GenericTypographic); <br />
SizeF size; <br />
<br />
MethodInfo mi = gridTasks.GetType().GetMethod("get_DataGridRows", <br />
BindingFlags.FlattenHierarchy | BindingFlags.IgnoreCase | BindingFlags.Instance <br />
| BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.Static); <br />
System.Array dgra = (System.Array)mi.Invoke(gridTasks,null); <br />
<br />
ArrayList DataGridRows = new ArrayList(); <br />
<br />
foreach (object dgrr in dgra) <br />
{ <br />
if (dgrr.ToString().EndsWith("DataGridRelationshipRow")==true) <br />
DataGridRows.Add(dgrr); <br />
} <br />
<br />
for (int i = 0; i < numRows; ++i) <br />
{ <br />
size = g.MeasureString(gridTasks[i,1].ToString(),gridTasks.Font,400,sf); <br />
int h = Convert.ToInt32(size.Height);<br />
h = h + 8; <br />
PropertyInfo pi = DataGridRows[i].GetType().GetProperty("Height"); <br />
pi.SetValue(DataGridRows[i],h,null); <br />
} <br />
g.Dispose(); <br />
}<br />
On the line "int numRows = ((DataTable)gridTasks.DataSource).Rows.Count;" I get the error: "Specified Cast is not valid.
I think there's problem with converting the datasource to a datatable??
I'm quite a beginner in programming. So probably it is something easy, but I can't find out what...
Thanks in advance,
Genius
Genius is 1% inspiration and 99% perspiration
|
|
|
|
|
I insert a TemplateColumn in a DataGrid(dgTest), and using "edit Template"to add a CheckBox,ID = cbx1 in "ItemTemplate" and also add a CheckBox ,ID=cbx2 in HeaderTemplate.
After that, I can use "((CheckBox)dgTest.Items[i].Cells[0].Controls[1]).Checked = true" to set the checked property of cbx1.
but how to set the checked property of cbx2???
I tried as follows,
"CheckBox cb=(CheckBox)dgTest.FindControl("cbx2");"
But it doesn't work.
Is there any other way to set this?
Thank you !
The future will not remember;
The past does not forget!
|
|
|
|
|
"((CheckBox)dgTest.Items[i].Cells[0].Controls[1])" is the cbx1?I think the cbx1 is the Controls[0] of the Cell.then cbx2 is the Controls[1].
or try the following Code:
CheckBox cb=(CheckBox)dgTest.Items[i].Cells[0].FindControl("cbx2");
|
|
|
|
|
I can get the CheckBox_cbx1 by using the following code:
CheckBox cb=(CheckBox)dgTest.Items[i].Cells[0].FindControl("cbx1");
But I can't get cbx2 in the same way.........
I think the key point is : cbx1 is in ItemTemplate ;well ,cbx2 is in HeaderTemplate. And dgTest.Item refers to the rows in DataGrid object but not refers to the Header .
So ,is there some other suggestion ?
The future will not remember;
The past does not forget!
|
|
|
|
|
Hi All,
I have a user Control derived from "System.Windows.Forms.UserControl"
I want to Serialize this but when i try to Serialize it,exception occurs
which reads:
"The type System.Windows.Forms.UserControl in Assembly System.Windows.Forms
...............
is not marked as serializable."
Is it not allowed to serialize UserControl,or is there any other way??
Thanks
TusharM.
|
|
|
|
|
Hello,
Now I am developing a application
1.COM+ have a fuction calling procedure(insert record)2.XMLWEBService have a function calling COM+.
3.The client call XMLWebService to update database.
I would like to the following situation.
-----------------------------------------------------
This client call a method of XMLWebService several times.
This method insert record to database (via COM+).
In this time, database transaction don't commit.
After calling, this call another method of XMLWebService at once.
This method have a roll "commit".
At last, this transaction finished.
-----------------------------------------------------
The transaction attribute of the method called procedure in COM+ set false, and in XMLWebService, I issued ContextUtil.SetComplete(); but transaction was disable.
This case, "As 1 session of XMLWebService several transaction of COM+" is OK by MTS(COM+).
but "As several session of XMLWebService, several transaction of COM+ and 1 commit" is not OK.
If you have some idea, please tell me.
best regards,
yu-yu
|
|
|
|