 |
 |
Index ‹ DotNet ‹ Dotnet
|
- Previous
- 1
- Visual C#.Net >> advice for simple scenariohey all,
i have a gridview inside my web user control that's inside my .aspx page. i
have the CRUD(create,read,update,delete) buttons on my .aspx page but outside
the user control.
the rule is i have to select a row in the gridview in order for the edit
link to be enabled. and if the new button is pushed i have to disable the
other links appropriately (Cancel is enabled, Edit is disabled, Delete would
be disabled, etc)
i guess what i'm asking what's the best way to keep the CRUD buttons sync
when my gridview is inside a user control but the CRUD buttons have to reside
outside that user control?
thanks,
rodchar
- 2
- 3
- 4
- 5
- ADO >> AdapterI need use adapter to update a database. However, the
table column contain an Indentity column which need
run "Set indentity_insert ON" first during the SAME
SESSION.
This is what I use:
sqlconn.open
sqlcmd.executenonquery ' run Set ... on
sqladapter.update(.....)
The adapter statement gave message that the indenity
column still off.
Anything wrong, any suggestion?
Ying
- 6
- Visual C#.Net >> Need help with Reflection from static method and child-classHi,
Suppose I have the following pseudo-class-ish code:
class A
{
member1;
member2;
public static Method() { return member1; }
}
class B : A
{
public static string Xxstring = "XXXXX";
B()
{
member1 = Xxstring;
member2 = Xxstring + Xxstring;
}
}
Now if I do the following:
B.Method() it will not work (return null) because the B's constructor was
not called as a result of the operation.
So I was hoping if there was some way i can determine from inside A.Method
that it was called from B and then I could get the type in B, and then
replace the member1 call with the Xxstring.
I have 80 or so child-classes of type A in my code and was hoping i could
refactor by doing this. Thanks.
- 7
- 8
- 9
- ADO >> how to retrieve ddl script from a db object..?Hi,
How to get (plain text) ddl script for databese objects in a sql server db..?
for example:
CREATE TABLE [dbo].[T_BatchLog] (
[ndBatchLog] int IDENTITY(1, 1) NOT NULL,
[ndBatchRun] int NOT NULL,
[ddDate] datetime NOT NULL,
[sdDescription] varchar(200) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
CONSTRAINT [PK_BatchLog] PRIMARY KEY CLUSTERED ([ndBatchLog]),
CONSTRAINT [FK_BatchLog_BatchRun] FOREIGN KEY ([ndBatchRun])
REFERENCES [dbo].[T_BatchRun] ([ndBatchRun])
ON UPDATE NO ACTION
ON DELETE NO ACTION
)
ON [PRIMARY]
GO
- 10
- ADO >> How do you use OleDbLiteral?I had already posted this message in the framework group when I spotted that
this group might be more apt.
I am completely baffled by the OleDbLiteral enumeration.
How do you get from the enumerated values to the things that they
represent?
I can't see any calls or methods that do this. ToString just returns the
name of the enumerated value.
This must be a really stupid question but I can't find a single worked
example that uses this class. either through google or in the 2 ADO.NET
books that I have bought.
You need this information to generate safe SQL that will run against a
variety of back-ends.
Tom
- 11
- Visual C#.Net >> Working set increasesEnvironment: Windows Server 2003 EE, .Net Framework 1.1, C#
I have a problem of memory usage growing continuously.
Basically, my application is a windows service that polls a webservice
method. This method returns a string array which is normally empty, and no
action is performed. Every 30 secs (polling time) the memory usage raises of
few KB.
Do you have any idea about what can cause this working set increment?
I report here the code of the timer event handler for who feels like having
a look.
// Timer.Elapsed event handler
public static void OnTimedEvent(object source, ElapsedEventArgs e)
{
timer.Enabled=false;
IniData ini=IniData.Instance(); // initialization class (singleton)
Logger log=Logger.Instance(); // log class (singleton)
try
{
WebService jgpm=new WebService(); // The web service is secured by using
https and certificates
X509Certificate x509 =
X509Certificate.CreateFromCertFile(ini.getCerFileName());
jgpm.ClientCertificates.Add(x509);
jgpm.Url=ini.getWsUrlRoot()";
string s=x509.GetName();
string[] tickets=jgpm.getOrders(s); // WEB SERVICE METHOD
foreach (string ticket in tickets) // tickets is normally empty and the
statement is not executed
{
// ticket elaboration
}
}
catch (Exception exc)
{
log.Debug(exc.Message);
}
timer.Enabled=true;
}
- 12
- ADO >> SPs/ADO.NET/DataSets/DataTables/DataAdapters/TableMappingHi all,
I posted this in the EnterpriseDevelopment.SQLServer.Programming group and
got a reccomendation that I post it here too.
This is probably a no-brainer, but I'm having a heck of a time trying to
form my question the right way for the search engines to return anything
meaningful.
I'm working with SQL Server 2000 and C# on .NET 1.1.
Letâ??s say that I have a stored procedure which looks like this
CREATE PROCEDURE [Get_Configuration]
AS
SELECT * FROM Table1
SELECT * FROM Table2
SELECT * FROM Table3
Now letâ??s also say that I have some .net code that looks like
System.Data.SqlClient.SqlCommand MyCommand = new
System.Data.SqlClient.SqlCommand("Get_Configuration",this.sqlConnection1);
MyCommand.CommandType = System.Data.CommandType.StoredProcedure;
System.Data.DataSet MyDs = new DataSet();
System.Data.SqlClient.SqlDataAdapter MyAdapter = new
System.Data.SqlClient.SqlDataAdapter(MyCommand);
MyAdapter.Fill(MyDs);
What I get back is a DataSet containing the 3 DataTables I want, however all
of the DataTables are named ("Table", "Table1" and "Table2")
I want to know how I can name those tables in T-SQL so that when DataAdapter
fills the DataSet with the DataTables I can program against the table names
instead of relying on the table position indexes.
This is because I know this stored procedure will change over time and I
would rather not have to keep going back to the code to modify the table
indexes.
I have tried making in memory tables and performing an SELECT INTO, but in
that in doing that I donâ??t get any DataTables back.
I did some research on the topic and understand that this is due to the way
the DataAdapter performs the Fill method and that it makes new table Objects
for each result set that the SP provides. I also understand how TableMapping
plays into the issue. But I have a genuine situation where I don't always
know the names of the tables before hand.
I have a statistical Stored Procedure library which is broken into smaller
pieces, but are called in succession from a master statistical SP. As time
goes on I'm always adding new dimensions to the report and allowing for new
tables of data to be returned. The problem I'm having is in the fact that I
don't want to have to constantly have to keep updating my front end
application each time a place a new table in the middle of the SP.
I think I have found a work around that I can use for now, which involves
creating an extra table at either the beginning or end of the SP which
returns specific meta-data about the tables being returned, which I can read
at the beginning of my Front End's execution.....I'm just hoping that there
is someone out there who has come up with a solution to this issue.
Thanks to anyone who can help,
John Rossitter
- 13
- Visual C#.Net >> A More Effecient Threading?I am working with an application that requires multithreading. I have found
a sample online that I am currently working with/learning from. However, I
am not sure if this is the most effecient way or most current way of
threading. Here is the sample I have found. I'd appreciate any
feedback/recommendations on better ways to use threading if this sample will
not suffice:
public partial class Form1 : Form
{
private void Form1_Load(object sender, EventArgs e)
{
int iFrom = 0;
int iTo = 5;
LA = new LH[iTo - iFrom + 1];
for (int i = iFrom; i <= iTo; i++)
{
//class defines thread start routine and data
LH Line = new LH();
LH[iTr - iFrom] = Line;
//pass parameters to the new thread
Line.iTr = i;
Line.MainForm = this;
ThreadStart ts = new ThreadStart(Line.ProcessingThread);
Thread wrkThread = new Thread(ts);
Line.CurrentThread = wrkThread;
wrkThread.SetApartmentState(ApartmentState.STA);
//default is MTA
wrkThread.Name = i.ToString(); //for easier tracing
wrkThread.Start();
Thread.Sleep(2000); //add some time for processing
}
}
public class LH
{
public Form1 MainForm = null;
public int iTr = -1;
public Thread CurrentThread = null;
public void ProcessingThread()
{
int iThreadId = CurrentThread.GetHashCode();
try
{
//events here
}
catch (COMException e)
{
return;
}
catch (Exception e)
{
return;
}
Application.Run();
}
}
Thanks for the assistance.
- 14
- Microsoft Project >> After Timesheet Update Project no longer displays in Timesheet VieWe are using Project Server 2003.
We have a regular project plan (not an administrative plan) to track
miscellaneous administrative activities. The plan contains approximately 6
Summary Tasks. Team members use the plan via the 'Create A New Task'
function when they need to record time against this plan. The plan will
display in their Task Page and they are able to enter time for the newly
created task. However, when they do an update all the project plan no longer
is displayed in their Task Page. Changing the option on the Task Page to
display All Activities doesn't have any affect. The acutal time is captured
and reported to the project manager, but the project plan no longer remains
on their Task Page. Why? This plan was also added in our Project 2003
development environment and it remains on the Task Page after an update; it
doesn't behave the same as the version in production. Why is it disappearing
in our production environment?
Also, we have another plan that is similar where by team members record
non-project related support for existing applications. The plan is the same
concept as the plan to track miscellaneous administrative activities, except
we have a Summary Task for each application that our area supports. Team
members use again use the 'Create a New Task' feature to update this plan.
This plan doesn't disappear from their Task Page in the Development or
Production environment after doing an update.
So I do know that the behavior that I am seeing with the miscellaneous
administrative activities is unique to our production environment and only to
this one plan. Help!
--
Thanks,
Kelly
- 15
- Visual C#.Net >> Very Easy Question, How to write log to SECURTY Event Log? Please helpIs there any special code I have to write to log event to Security
Event Log? The following code give me "Very Easy Question, How to
write log to SECURTY Event Log? Please help" Error
// Create an EventLog instance and assign its source.
EventLog myLog = new EventLog();
myLog.Source = "Security";
// Write an informational entry to the event log.
myLog.WriteEntry("Writing warning to event log.",
EventLogEntryType.Warning);
but as soon as I change "Security" to "Application" ,
everything works fine
// Create an EventLog instance and assign its source.
EventLog myLog = new EventLog();
myLog.Source = "Application";
// Write an informational entry to the event log.
myLog.WriteEntry("Writing warning to event log.",
EventLogEntryType.Warning);
Any ideas?
Thanks in advance
John
|
| Author |
Message |
cawhite

|
Posted: Mon Dec 27 15:52:30 CST 2004 |
Top |
Dotnet >> Application Fail
If I put my .exe file on my Local Network (in a Folder of course) and try to
run from my Pc which would be the causes ? such application don't Run.
I make the Wrap a COM component for Export data to MS-Excel:
Interop.Excel.dll
Interop.VBIDE.dll
Note: Only Run in my local PC
Best Regard
Mario
DotNet63
|
| |
|
| |
 |
Chris,

|
Posted: Mon Dec 27 15:52:30 CST 2004 |
Top |
Dotnet >> Application Fail
What error are you getting?
Check the sercurity settings. If you use the default settings for the .Net
framework you will not be able to run an exe from a local Network drive.
You will have give the app permissions in the Microsoft .NET Framework 1.1
Wizards/Conifgurations.
Chris
"Mario Reiley" <EMail@HideDomain.com> wrote in message
news:usD$EMail@HideDomain.com...
> If I put my .exe file on my Local Network (in a Folder of course) and try
> to
> run from my Pc which would be the causes ? such application don't Run.
>
> I make the Wrap a COM component for Export data to MS-Excel:
>
> Interop.Excel.dll
> Interop.VBIDE.dll
>
> Note: Only Run in my local PC
>
> Best Regard
> Mario
>
>
>
>
|
| |
|
| |
 |
Cor

|
Posted: Tue Dec 28 03:48:07 CST 2004 |
Top |
Dotnet >> Application Fail
Mario,
In addition to Chriss, the first thing that is important, is that you need
forever the right framework on the processing computer to run a dotNet
windows program (not a webform)..
I hope this helps?
Cor
|
| |
|
| |
 |
RINTU

|
Posted: Tue Dec 28 05:09:03 CST 2004 |
Top |
Dotnet >> Application Fail
In a VB.NET Project after creating Windows Form
when i put any control on the Form and running the Application
it Dispalying an Error message "Overflow Underflow " and aplication
is switching into break/debug mode.
|
| |
|
| |
 |
| |
 |
Index ‹ DotNet ‹ Dotnet |
- Next
- 1
- Visual C#.Net >> hiding a rows in DataGridViewComboBoxColumnAfter a value from the combobox has been selected in a previous row of the
DataGridView, I would like to hide that value from being selectable in the
combobox in a new row of the DataGridView.
Here is a visual sample of what I'm trying to do:
http://oha.nu/accepted_creditcards.gif
I've found code to hide rows from DataGridView, but not from the
DataGridViewComboBoxColumn.
Any help much appreciated.
thanks,
Nik Edmiidz
- 2
- Dotnet >> .NET control event with java script handlerHi all,
I have created a .NET Windows control with c#.
I have placed the control on a HTML page within the OBJECT element.
Everything works fine up to now.
Now, I wanna implement the following stuff that the control must support.
The control must provide a method called InvokeJavaScriptFunction
The prototype of this method is:
InvokeJavaScriptFunction(<point to java script function>)
where <point to java script function> is a pointer to an existing java
script function in the HTML page.
The InvokeJavaScriptFunction method of the control is invoked within the
HTML page when the page is loading
<head>
<script language="javascript">
function MyJScriptFunction()
{
....
}
</script>
<OBJECT id="MyControl" .....>
</OBJECT>
</head>
<body onLoad="MyControl.InvokeJavaScriptFunction(MyJScriptFunction)">
.....
</body>
Inside the control.... the InvokeJavaScriptFunction is performing some stuff
and after that it should invoke the java script function on the page.
In other words, the InvokeJavaScriptFunction takes some actions and then it
must turn back the control on the page invoking the script function.
You can think at this like to an event.. the InvokeJavaScriptFunction is
doing its job and then fires an event on the page, where the handler of the
event is the provided java script function.
Do you have any idea how to implement this must have functionality of my
control?
Thanks,
Mircea
- 3
- Net Framework >> Class not registeredHi Every one,
I am developing web application using c# in Visual Studio 2005 Beta 1. When
I try to connect my SQL database, I am getting error
"System.Data.OleDb.OleDbException: Class not registered". My database is in
Sql Server 2000. I am using OLEDB namespace. For some specific business need
I am using oledb namespace instead of sql name space of system.data. Can any
body help me in resolving this.
Thanks in advance.
Shailesh.
- 4
- Dotnet >> Desktop will not display shortcutsI down loaded and installed iTunes update. Noted that it took a long time to
"finalize". When finished iTunes shortcut had disapeared. When I restarted
computer all shortcuts were gone from desktop.
Restore function will not restore to any point prior to install.
Shortcuts sent to desktop do not appear.
Any ideas?
--
RFP
- 5
- Net Framework >> Looking for a book on writing ASP.NET Controls with VB.NETI am an ASP.NET developer who would like to start learning about writing
ASP.NET custom controls using VB.NET. I already have a reasonable amount of
knowledge with making ASP.NET pages, and am looking for a book specifically
on writing controls. Here are some things I would like the book to talk
about and my preferences as to how I would like it to be shown/explained:
1. I want it to use VB.NET for the examples, since that is what I write all
my sites using and have experience with.
2. I would prefer that the book use many examples, because I feel I learn
better when I see examples.
3. I want to know how to make the different properties be either displayed
or not displayed in the Visual Studio .NET Properties Palette, as well as
other things that affect the appearance in Visual Studio .NET.
4. I want it to concentrate only on ASP.NET Custom Controls.
Thank you in advance to anyone that can help me find a book on this topic.
--
Nathan Sokalski
njsokalski@hotmail.com
http://www.nathansokalski.com/
- 6
- Visual C#.Net >> simulate copy commandHow do I run following from csharp from "server"?
copy file.txt \\server\printer1
Also how can I submit a text file print job to local print queue "printer1"?
Assuming I run copy command from server.
TIA!
- 7
- 8
- Dotnet >> ASP.NET Integrated AuthenticationI'm developing a web application for our local intranet that will allow users
to pull up a webpage and update or deleted or insert records into a database
as well as run reports etc...
Our DB server is on a Win2k3 OS using SQL Server 2000
Our Web server is on a separate Win2kr OS using IIS 6
Both the servers and the clients are part of the same domain.
We've turned anonymous access off on the web and are passing the integrated
authentication from the client's machine (through their domain login). The
user has been granted all the correct permission to the database server and
the database that will be updated. However it seems like the authentication
is being passed to the web server and then the web server is passing a
different set of authentication on to the database server? The
authentication it is passing on to the database server is DOMAIN\MACHINENAME$.
If we add that machine name to the SQL Server as having permission to do the
update/delete/select we can get the app to work just fine. However, what we
want to do is to pass the clients authentication on to the database server...
not the web serverâ??s authentication.
Any help I could get would be much appreciated..... this is driving me nuts
and seems like a pretty common practice (having the db and the web on two
separate machines).
Thanks in advance.
Josh
- 9
- Winforms >> tabPage.Focus() doesn't work?Hi,
I have a TabControl in a WinForm witn two tabs.
At some point I want to switch focus from the first TabPage to the second
TabPage.
The documentation says that any control (which seems to be the case for the
TabControl) that derives from Panel aren't selectable.
Since I think this is a simple wish I can't imagine that there shouldn't be
a workaround for that. Do you have helping ideas?
Thank you very much.
Torben
- 10
- ADO >> Getting Data from a DataSetHello,
I have a DataSet that was returned from a QueryMethod ( ).
Using the following code, I drilled down to the column level but am unsure
how to get at the data:
Dim ds As System.Data.DataSet
Dim dt As System.Data.DataTable
Dim dr As System.Data.DataRow
Dim dc As System.Data.DataColumn
ds = QueryMethod()
For Each dt In ds.Tables
For Each dr In dt.Rows
For Each dc In dt.Columns
if dr(dc) = "owner" then
' GET DATA VALUE IN THE TABLE IN THE ROW OF THE COLUMN
end if
Next dc
Next dr
Next dt
Thanks for any help.
glenn
- 11
- ADO >> Use OleDB DB2 provider type without extra software?I recently realized that I need IBM's iSeries Access installed to use
Provider=IBMDA400.DataSource.1 in an OleDB connection string.
Is there any .NET 2.0 class or dll that provides DB2 data access
without any other software installs besides the .NET 2.0 Framework? Or,
alternatively, can I pack whichever specific class/dll provides
IBMDA400.DataSource.1 into the project itself (and not as a reference
to it externally)?
- 12
- Net Framework >> Profiling/Debugging Real Time Security ChecksI have a medium sized application (say 50k lines) that occasionally will
spike the % of time in RT security checks performance counter between 50 and
95%.
It can perform hundreds of thousands of code access security permission
checks in a few seconds in some cases.
I know that I can set a permission set on a higher level method and demand
then assert to help allieviate some of these checks, but how do I go about
determining what method to assert the permissions and which permissions to
assert?
I guess what I'd really like is to get a list of methods with the number of
calls and the number of code access security permission checks performed
(inclusive and exclusive).
Any ideas of how I can go about profiling/debugging this issue?
- 13
- ADO >> ADO.NET 2.0 - Simple question for you...I have an ASP.NET 2.0 website. I want to write a function in ADO.NET 2.0
(VB.NET) that does the following:
1. Opens up a connection to my SqlExpress db. (The connectionstring is in
the <connectionStrings> section of my web.config)
2. Runs a query, storing results in a datatable.
3. Closes connection
Can anyone assist?
Thanks!
- 14
- Visual C#.Net >> adding icons to controlsHi!
I have made a few custom controls. E.g. I have a ColorTextBox which inherits
the TextBox class...
When I build the project and add it to the toolbar (through Add/Remove
Items) the control has
the default icon next to it...
Is there a way I can change the icon displayed in the toolbar? Through some
attribute perhaps?
Thanks...
Saso
- 15
- ADO >> Crystal Report - Page break after Report header !Hi all,
I'm actually encountering the following problem. I've got a report
with standard report header, page header and detail sections. But on
viewing mode, CR generates everytime a page break right after the
report header section, so the data start to be displayed only on the
second page. When all data could fit on only one page, it worked good.
The problem came when i added more fields, to report, needing 3 pages
at least. I don't know why, CR does this, where is it told to generate
this page break, cause the options "New page after, before" are not
checked.
Any help apreciated,
Thanks,
Mike.
|
|
|