Showing newest 48 of 732 posts from February 2009. Show older posts
Showing newest 48 of 732 posts from February 2009. Show older posts

Saturday, February 28, 2009

[DotNetDevelopment] Re: Question regarding ThreadPool

Simply Join All Threads one By One

On 2/24/09, Benj Nunez <benjnunez@gmail.com> wrote:
>
> " Is there any other way I can wait for all threads to
> complete ?"
>
>
> Hi there,
>
> This article might give you a clue:
>
> http://www.codeproject.com/KB/threads/waitforthreads.aspx
>
>
> Cheers,
>
>
> Benj
>
>
>
> On Feb 23, 10:56 pm, graphicsxp <graphic...@googlemail.com> wrote:
>> Actually SetMaxThreads does work, I wasn't testing properly.
>>
>> If I do : ThreadPool.SetMaxThreads(2, 2);
>>
>> I can see my threads being queued to the pool, but then they only
>> complete by batch of two, which is exactly what I would expect :)
>>
>> I have another question though. I'm using an array of ManualResetEvent
>> to wait for all threads. Unfortunately they are limited to 64
>> events !  Is there any other way I can wait for all threads to
>> complete ?
>>
>> Thanks

[DotNetDevelopment] Re: Windows form inside a Panel

I CANT UNDERSTAND UR 1ST QUESTION , But If my understanding is good it
can be solved by opening secod form as dialog and dont use any form as
topmost.

for second problem u can just set forms borderstyle property NoBorder

On 2/23/09, Savani Mahesh <mdhelloworld@gmail.com> wrote:
> Hi,
>
> Visual Studio 2005, C# .Net 2.0. Window Forms Application.
>
> I created a form with 2 panels. One panel containing 3 links to other 3
> forms, second panel to hold the form. When user clicks on a link, I create
> instance of form, set its TopLevel property to false and add the form to
> second panel.
>
> Problems I am facing are,
> 1) Form residing into the panel never get focus. So all shortcuts which
> works fine, when form is opened normally as a TopLevel control, do not work.
> The reason I guess is that "Form Into Panel" never gets windows messages,
> generated by OS central message loop, instead its parent form gets messages.
>
> 2) The form added to panel is floating. How to stop floating?
>
> Please any one can help.
>
> Regards,
> Mahesh
>

[DotNetDevelopment] Re: Login failed error when accessing Crystal report

Double check your connection string that you use to connect to your
database server (local/remote). Check the Hostname/IP Address and
authentication mode (provide username & password if required).

Thanks
TFR.

On Sat, Feb 28, 2009 at 1:36 AM, Lee Gunn <lee.gunn@secretorange.co.uk> wrote:
> Hi,
>
> Sounds like you either want to use SQL Server authentication ie supply a username and password in the connection string or create a login in sql server for the account that asp.net is running under.
>
> lee
>
> ------------
>
> http://www.jiba-jaba.com <http://www.jiba-jaba.com>
> -- The Home of Public Microblogging
>
> ________________________________
>
> From: DotNetDevelopment@googlegroups.com on behalf of Stacie
> Sent: Fri 27/02/2009 18:40
> To: DotNetDevelopment, VB.NET, C# .NET, ADO.NET, ASP.NET, XML, XML Web Services,.NET Remoting
> Subject: [DotNetDevelopment] Login failed error when accessing Crystal report
>
>
>
>
> I have a Crystal report included in my web app.  After deploying my
> web app to my web server when I try to access the report I receive the
> following error "Logon failed. Details: ADO Error Code: 0x Source:
> Microsoft OLE DB Provider for SQL Server Description: Login failed for
> user '(null)'. Reason: Not associated with a trusted SQL Server
> connection. SQL State: 42000 Native Error: Error in File C:\WINDOWS
> \TEMP\Timecard {D01BFAAC-FA1F-4D29-8C7F-456964301B5C}.rpt: Unable to
> connect: incorrect log on parameters."
>
> I can access the report on my dev server with no problems.  Does
> anyone know how to fix this error?
>
>
>

[DotNetDevelopment] ASP.NET application performance counters - no apps listed

Hi,

On my PCs and servers, when I go to look at Performance Counters for
ASP.NET applications (i.e. per app - requests/sec etc), there are no
apps listed.

According to MSDN, selecting performance object "ASP.NET Apps
v2.0.50727", should give a list of app instances, and a "__Total__"
instance, representing the total from all apps. However, I only get
"__Total__" wherever I look. There are many ASP.NET 2 apps correctly
configured and running on all the PCs and servers I tried. Same for
"ASP.NET Apps v1.1.4322". I want stats for just one app though!

If you go Control Panel, Administrative Tools, Performance, Add a
counter (The +), select "ASP.NET Apps v2.0.50727", does anyone else
get the apps listed? I am really quite lost, all over the net there
are references to it but no-one with a similar problem!

Can anyone help? This occurs on all the XP Pro / Windows Server 2003
machines I have. They all have all the .NET framework SPs, including
3.5 and 3.5 SP1.

Please, any suggestions greatly welcomed.

Thanks
Kieren

Just 4 Laugh Gags People Choice. Lemonade kids Very Funny. | Fachak

Shared @ Fachak

[DotNetDevelopment] Re: [Visual Basic .Net] Let the User build his properties

Create a few utility text properties and let them edit those? That would be the fast and easy way out.

[DotNetDevelopment] Re: [Visual Basic .Net] Let the User build his properties

Hi...

Well... Reflection may do it for you, but it's not very intersting, because in development time you don't know the properties, methods etc.

The best thing to do is a Abstract Class, something like a Costumer, that implements the commom properties to the costumers...
Then you may implement a specialized class for the other type of costumers:

public abstract class Costumer
{
protected string Name {get;set;}
protected string Address {get; set;}
//other commom properties

//commom methods
}

public class CostumerX : Costumer
{
protected string Telephone {get; set;}
protected string SoftwareNumber {get; set;}
}
public class CostumerY : Costumer
{
protected string Hobbies {get; set;}
protected string Website {get; set;}
}

Now you can do it:
Costumer costumerX = new CosctumerX();
costumerX.Name = "Some name";
costumerX.Telephone = "12345";

But you cannot do:
costumerX.Hobbies, because Hobbies is a property of the CostumerY class.

Regards,
Vinicius Quaiato.

On Fri, Feb 27, 2009 at 7:04 AM, Belisario <kamen82@gmail.com> wrote:

Hello everybody!

I'm a VB.Net beginner.
I'm trying to understand if it's possible to create a class with a
method in it to add new properties to this class.

Let me put it better: I am building a customer class. This would have
some base fixed properties like "Name" or "Address", but I would like
to give the user the possibility to build his own free custom
property, like "Telephone Number" and "Software version" for Mr. Smith
and "Customer hobbies" and "Website" for Mr. Brown.
So:

Mr. Smith's Customer Object properties:
"Name"
"Address"
"Telephone Number"
"Software version"

Mr. Brown Customer Object properties:
"Name"
"Address"
"Customer hobbies"
"Website"

I searched a lot through the net but I still can't understand if this
is possible and how. I heard about something called "reflection", but
I am still not sure if I am searching the right way...

Could you please help me on this point or show me other possible ways
to overcome the issue?

Thank you very much!

[DotNetDevelopment] Re: Let the User build his properties

Two things that a end developer can do with your class is <b>inherit</
b> your class and build upon it. They can also use the new
<b>Extension</b> methods in framework 3.0. Let me know if this helped
you.

On Feb 27, 6:04 am, Belisario <kame...@gmail.com> wrote:
> Hello everybody!
>
> I'm a VB.Net beginner.
> I'm trying to understand if it's possible to create a class with a
> method in it to add new properties to this class.
>
> Let me put it better: I am building a customer class. This would have
> some base fixed properties like "Name" or "Address", but I would like
> to give the user the possibility to build his own free custom
> property, like "Telephone Number" and "Software version" for Mr. Smith
> and "Customer hobbies" and "Website" for Mr. Brown.
> So:
>
> Mr. Smith's Customer Object properties:
> "Name"
> "Address"
> "Telephone Number"
> "Software version"
>
> Mr. Brown Customer Object properties:
> "Name"
> "Address"
> "Customer hobbies"
> "Website"
>
> I searched a lot through the net but I still can't understand if this
> is possible and how. I heard about something called "reflection", but
> I am still not sure if I am searching the right way...
>
> Could you please help me on this point or show me other possible ways
> to overcome the issue?
>
> Thank you very much!

[DotNetDevelopment] Re: Login failed error when accessing Crystal report

I had a similar problem about a year and a half ago with Crystal. I
think it came down to something like on the dev machine the report
runs from a specific directory. When the system is deployed it runs
from a different directory and cannot find a dll or file. I'm trying
to remember what the exact solution was but maybe in the mean time
this will give you a clue as to where to look..


On Feb 27, 2:40 pm, Stacie <imsta...@gmail.com> wrote:
> I have a Crystal report included in my web app.  After deploying my
> web app to my web server when I try to access the report I receive the
> following error "Logon failed. Details: ADO Error Code: 0x Source:
> Microsoft OLE DB Provider for SQL Server Description: Login failed for
> user '(null)'. Reason: Not associated with a trusted SQL Server
> connection. SQL State: 42000 Native Error: Error in File C:\WINDOWS
> \TEMP\Timecard {D01BFAAC-FA1F-4D29-8C7F-456964301B5C}.rpt: Unable to
> connect: incorrect log on parameters."
>
> I can access the report on my dev server with no problems.  Does
> anyone know how to fix this error?

[DotNetDevelopment] Re: Login failed error when accessing Crystal report

Hi,

Sounds like you either want to use SQL Server authentication ie supply a username and password in the connection string or create a login in sql server for the account that asp.net is running under.

lee

------------

http://www.jiba-jaba.com <http://www.jiba-jaba.com>
-- The Home of Public Microblogging

________________________________

From: DotNetDevelopment@googlegroups.com on behalf of Stacie
Sent: Fri 27/02/2009 18:40
To: DotNetDevelopment, VB.NET, C# .NET, ADO.NET, ASP.NET, XML, XML Web Services,.NET Remoting
Subject: [DotNetDevelopment] Login failed error when accessing Crystal report


I have a Crystal report included in my web app. After deploying my
web app to my web server when I try to access the report I receive the
following error "Logon failed. Details: ADO Error Code: 0x Source:
Microsoft OLE DB Provider for SQL Server Description: Login failed for
user '(null)'. Reason: Not associated with a trusted SQL Server
connection. SQL State: 42000 Native Error: Error in File C:\WINDOWS
\TEMP\Timecard {D01BFAAC-FA1F-4D29-8C7F-456964301B5C}.rpt: Unable to
connect: incorrect log on parameters."

I can access the report on my dev server with no problems. Does
anyone know how to fix this error?

Friday, February 27, 2009

[DotNetDevelopment] Login failed error when accessing Crystal report

I have a Crystal report included in my web app. After deploying my
web app to my web server when I try to access the report I receive the
following error "Logon failed. Details: ADO Error Code: 0x Source:
Microsoft OLE DB Provider for SQL Server Description: Login failed for
user '(null)'. Reason: Not associated with a trusted SQL Server
connection. SQL State: 42000 Native Error: Error in File C:\WINDOWS
\TEMP\Timecard {D01BFAAC-FA1F-4D29-8C7F-456964301B5C}.rpt: Unable to
connect: incorrect log on parameters."

I can access the report on my dev server with no problems. Does
anyone know how to fix this error?

[DotNetDevelopment] Re: Problem while Inserting with DataAdapter.

Arun is quite right. I cannot count the no. of times I have stressed
this fact: Never call AcceptChanges before calling Update.

Trip down memory lane:
---------------------------------
http://groups.google.co.in/group/DotNetDevelopment/browse_thread/thread/90c61f5f9eaa2959
http://groups.google.co.in/group/DotNetDevelopment/browse_thread/thread/1c8d34e74442dc7c
http://groups.google.co.in/group/DotNetDevelopment/browse_thread/thread/8398c6b6c6f81d82
http://groups.google.co.in/group/DotNetDevelopment/browse_thread/thread/e4b3d7099721118f
http://groups.google.co.in/group/DotNetDevelopment/browse_thread/thread/8ceb6c0a4d84389e

On Feb 27, 10:52 am, ArunKumar <carunkumar1...@gmail.com> wrote:
> Yes Now i am understand ur problem and ur solution 2 ur problem
> why i am sending this
> ie BeginEdit/EndEdit this is pushed to change the row state
>
> Now i am come to ur solution
> Don't call acceptchanges method before Update
>
> My sugg
>
> what ever u can do with ur data table ie (new row
> added,Modified,Deleted etc..)
> then finaly call on single stmt
> If Not DataTable.GetChanges Is Nothing Then adapter.Update
> (DataTable.GetChanges)
> DataTable.AcceptChanges()
>

[DotNetDevelopment] Re: Change Width of TextBox in EditItemTemplate of GridView Control

Hi,

Please check following links, hope these will help you.

1. http://forums.asp.net/t/1177241.aspx
2. http://forums.asp.net/t/1018483.aspx

Thanks

[DotNetDevelopment] SQL Reporting services automatically formatting queries.

When creating a report server project in Visual Studio, my SQL queries
will automatically get formatted when editing them, like adding spaces
and placing stuff on new lines so it gets more readable.

There's nothing wrong with that, but it also disables the function to
comment in SQL queries. Whenever i add comments, they automatically
get filtered out of there.

Is there any way to disable this 'feature'?

[DotNetDevelopment] Re: saving any type file in sql server 2000 by asp.net

Store the file data in a Binary field.

Lee

------
http://www.jiba-jaba.com
- The home of public Microblogging

On Feb 26, 7:10 am, tahir rameez <tahir.ram...@gmail.com> wrote:
> Please help me out, can any body give me compact solution to this
> problem, also let me know what should be type of field of table, in
> which file is to be stored.

[DotNetDevelopment] Custom Control with Data Type property

I'm building a custom user control. One of the properties must allow
the end user to select the numeric data type such as int, short, long,
double.... I'm having a problem figuring out what to use as a
internal property type, so that when the user selects the DataType
option in the property box it will give them a drop down list of all
the numeric types.

I've tried a few variances... This one below, when compiled display
the DataType property as grayed out. It won't allow me to select or
enter a value.

private System.ValueType _DataType;

public System.ValueType DataType
{

get { return _DataType; }
set
{

_DataType = value;
}
}

Any help is appreciated.
Thanks!

[DotNetDevelopment] Re: Special characters in DataView.RowFilter

Thank you very much to all....

I was handle that by considering it as two substrings....

Thank you very much

On Feb 25, 6:26 pm, Raghupathi Kamuni <raghukam...@gmail.com> wrote:
> Good link for DataView.RowFilter expressions
>
> http://aspdotnetcodebook.blogspot.com/2008/07/short-tutorial-on-datav...
>
> On Tue, Feb 24, 2009 at 3:06 PM, k.pradeep.kuma...@googlemail.com <
>
>
>
> k.pradeep.kuma...@googlemail.com> wrote:
>
> > I am getting the following exception
> > ----SynataxErrorException was unhandled by usercode
> > ----Syntax error: Missing operand after 's' operator.
>
> > On Feb 24, 2:26 pm, "k.pradeep.kuma...@googlemail.com"
> >  <k.pradeep.kuma...@googlemail.com> wrote:
> > > Hi all,
>
> > > Suppose if I have the data like below.
> > > SqlServer Table Emp:
>
> > >  EmpName                            Empno
> > > --------------------------------------------------------
> > >  Kumar's p                             123
> > >  bharat                                   124
> > >  pradeep'k kumar                    125
>
> > > I need to retrive only the 'kumar's p' related rows based on only
> > > ename And needs to bind to the grid.
> > > I am using dataview.rowfilter = "ename = 'kumar's p' . I am getting
> > > the exception.
>
> > > Please let me know how can I check this condition.
>
> > > Thank you in advance.
>
> > > Regards,
> > > Pradeep- Hide quoted text -
>
> - Show quoted text -

[DotNetDevelopment] [Visual Basic .Net] Let the User build his properties

Hello everybody!

I'm a VB.Net beginner.
I'm trying to understand if it's possible to create a class with a
method in it to add new properties to this class.

Let me put it better: I am building a customer class. This would have
some base fixed properties like "Name" or "Address", but I would like
to give the user the possibility to build his own free custom
property, like "Telephone Number" and "Software version" for Mr. Smith
and "Customer hobbies" and "Website" for Mr. Brown.
So:

Mr. Smith's Customer Object properties:
"Name"
"Address"
"Telephone Number"
"Software version"

Mr. Brown Customer Object properties:
"Name"
"Address"
"Customer hobbies"
"Website"

I searched a lot through the net but I still can't understand if this
is possible and how. I heard about something called "reflection", but
I am still not sure if I am searching the right way...

Could you please help me on this point or show me other possible ways
to overcome the issue?

Thank you very much!

[DotNetDevelopment] Re: saving any type file in sql server 2000 by asp.net

thanks every one for there comments and help,
i have found the soultion which i am posting here for othere pplz
refrence

aspx.code
<asp:Label ID="Label2" runat="server" Text="Title"></asp:Label>
<asp:Label ID="Label1" runat="server" Text="Label"></
asp:Label>
<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
<asp:Label ID="Label3" runat="server" Text="Image"></asp:Label>
<asp:FileUpload ID="FileUpload1" runat="server" />
<asp:Button ID="upload" runat="server" Text="Upload"/>
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$ ConnectionStrings:NorthwindConnectionString %>"
SelectCommand="SELECT [DOCID], [FileName], [FileType],
[SavedFile] FROM [DOCSAVE]">
</asp:SqlDataSource>
</div>
<asp:GridView ID="GridView1" runat="server"
AutoGenerateColumns="False" DataKeyNames="DOCID"
DataSourceID="SqlDataSource1">
<Columns>
<asp:CommandField ShowSelectButton="True" />
<asp:BoundField DataField="DOCID" HeaderText="DOCID"
InsertVisible="False" ReadOnly="True"
SortExpression="DOCID" />
<asp:BoundField DataField="FileName"
HeaderText="FileName" SortExpression="FileName" />
<asp:BoundField DataField="FileType"
HeaderText="FileType" SortExpression="FileType" />
</Columns>
</asp:GridView>
-
*******************************************************************************
code behind
-
*******************************************************************************
Protected Sub Upload_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Upload.Click
Dim fileUpload1 As FileUpload = CType(Me.FindControl
("fileUpload1"), FileUpload)
'Make sure a file has been successfully uploaded
If fileUpload1.PostedFile Is Nothing OrElse
String.IsNullOrEmpty(fileUpload1.PostedFile.FileName) OrElse
fileUpload1.PostedFile.InputStream Is Nothing Then
Label1.Text = "Please Upload Valid picture file"
Exit Sub
End If
'Make sure we are dealing with a JPG or GIF file
Dim extension As String = System.IO.Path.GetExtension
(fileUpload1.PostedFile.FileName).ToLower()
Dim MIMEType As String = Nothing
Select Case extension
Case ".gif"
MIMEType = "image/gif"
Case ".jpg", ".jpeg", ".jpe"
MIMEType = "image/jpeg"
Case ".png"
MIMEType = "image/png"
Case ".pdf"
MIMEType = "pdf"
Case ".doc"
MIMEType = "doc"
Case ".xls"
MIMEType = "xls"
Case Else
'Invalid file type uploaded
Label1.Text = "Not a Valid file format"
Exit Sub
End Select
'Connect to the database and insert a new record into Products
Using myConnection As New SqlConnection
(ConfigurationManager.ConnectionStrings
("NorthwindConnectionString").ConnectionString)
Const SQL As String = "insert into docsave
(FileName,FileType,SavedFile) VALUES (@Title, @MIMEType, @ImageData)"
Dim myCommand As New SqlCommand(SQL, myConnection)
myCommand.Parameters.AddWithValue("@Title",
TextBox1.Text.Trim())
myCommand.Parameters.AddWithValue("@MIMEType", MIMEType)
'Load FileUpload's InputStream into Byte array
Dim imageBytes(fileUpload1.PostedFile.InputStream.Length)
As Byte
fileUpload1.PostedFile.InputStream.Read(imageBytes, 0,
imageBytes.Length)
myCommand.Parameters.AddWithValue("@ImageData",
imageBytes)
myConnection.Open()
myCommand.ExecuteNonQuery()
myConnection.Close()
End Using
End Sub


Protected Sub GridView1_SelectedIndexChanged(ByVal sender As
Object, ByVal e As System.EventArgs) Handles
GridView1.SelectedIndexChanged
Dim strExtenstion As String = "extension of retrieved file"
Dim bytFile As Byte()
Dim strSql As String = "select * from docsave where docid = 3"
Dim myReader As SqlDataReader


Dim myConnection As New SqlConnection
(ConfigurationManager.ConnectionStrings
("NorthwindConnectionString").ConnectionString)
Dim myCommand As New SqlCommand(strSql, myConnection)
myConnection.Open()
myReader = myCommand.ExecuteReader


strExtenstion = ".doc"
' bytFile = myReader("savedfile")
Response.Clear()
Response.Buffer = True
If myReader.Read Then
If (strExtenstion = ".doc" Or strExtenstion = ".docx")
Then
Response.ContentType = "application/vnd.ms-word"
Response.AddHeader("content-disposition",
"attachment;filename=" & myReader("filename") & ".doc")
ElseIf (strExtenstion = ".xls" Or strExtenstion = ".xlsx")
Then
Response.ContentType = "application/vnd.ms-excel"
Response.AddHeader("content-disposition",
"attachment;filename=Tr.xls")
ElseIf (strExtenstion = ".pdf") Then
Response.ContentType = "application/pdf"
Response.AddHeader("content-disposition",
"attachment;filename=Tr.pdf")
End If
Response.Charset = ""
Response.Cache.SetCacheability(HttpCacheability.Private)
' If you write,
'Response.Write(bytFile1);
' then you will get only 13 byte in bytFile.

Response.BinaryWrite(myReader("savedfile"))

Response.End()
End If
myConnection.Close()

End Sub

On Feb 27, 10:11 am, Cerebrus <zorg...@sify.com> wrote:
> And I would have appreciated a well worded, detailed question that
> didn't keep the rest of us guessing about the problem.
>
> On Feb 26, 10:16 pm, tahir rameez <tahir.ram...@gmail.com> wrote:
>
>
>
> > i would have really appreciated if you answered my question rather
> > then criticizing me.- Hide quoted text -
>
> - Show quoted text -

[DotNetDevelopment] How to combine unknown number of query results into datatable/dataset?

Hi,

I have a situation where I have a number of queries in a stack. The
number is generally 1, but it can theoretically be any amount.

I need to execute the queries and then loop through the rows of each
query and then combine these results, the final combination is written
to a text file matching a particular archiving format.
The queries do not return the same nunber of columns or rows.
If query returns two rows 7 columns, query 2 returns 0 rows but has 4
possible columns (if it did return anything), and query 3 returns 3
rows 2 columns then the final output should be

3 rows 13 columns with the empty columns in the database replaced by
particular characters.

Currently I have an algorithm that does my output if I have 1 query.

what I was thinking was:

loop through number of queries, make new data adapter, loop through
rows, read rows into some data structure where I can append a
particular result by an index, for example an array and then at the
end loop through that data structure and write it out.

However I worry about that because of the potential size of what is
returned - say a couple MB is not an unwarranted expectation that the
choice of data structure becomes somewhat important. If I were to
follow this method what data structure do you think I should use?

The application does not need to have any particular good performance,
but it can't crash under the strain of too much data either.

Alternately if you can suggest something else that would be great, as
the method outlined above seems inefficient. Although the best I can
come up with under the constraints of the problem.

Thanks

[DotNetDevelopment] Freezing header & columns of a gridview in IE 6.0

Hi all,
I had freezed the header & columns of a gridview, but in IE
6.0, when we scroll the content, controls(dropdown dynamically added)
of the cells of gridview goes to the freezed header and columns area.
It is working fine in IE 7.0.
Could anyone please suggest me the remedy. the snapshot has been
provided below and also as attachment.

Thanks & Regards
Praveen Kumar Verma

[DotNetDevelopment] Re: Regarding Crysta Report

can you paste the code and error here.

On Fri, Feb 27, 2009 at 7:36 AM, vanitha palanisamy <vanitha86@gmail.com> wrote:
Hi,

I tried both methods.
But still the problem remains constant.


On Wed, Feb 25, 2009 at 10:27 PM, Ram Mohan Rama Chandran <rammoghan@gmail.com> wrote:
hi...
 
try this
 
Its Setdatabaselogin(id,pw) , this part of the reportdocument class.
 
or 
 
 
  1. Open SQL Server Management Studio
  2. Select database engine (server) where database is created.
  3. Select "Security" folder. Followed by "Logins" folder.
  4. Check if there is "<server name>\ASPNET" as user exists.
    • If not then right click on "Logins" folder & select "New Login".
    • User "Search" button if you want to make sure correct username path is added to the "Logins" list.
 Crystal report uses ASPNET user hence SQL server must user login for ASPNET account.


On Thu, Feb 26, 2009 at 8:08 AM, vanitha palanisamy <vanitha86@gmail.com> wrote:
HI


I changed table name as "Bill" but still the problem remains constant.



On Wed, Feb 25, 2009 at 2:33 AM, Jackie <jasminmistry@gmail.com> wrote:
Hi Vanitha,

Your query is "Select * from Bill" but you are setting the datasource for table "Products" (in code: rptDoc.SetDataSource(ds.
Tables["product"])), so can you try changing it to "Bill". The error I think is bcoz the dataset doesn't have the products table.


Jasmin



On Wed, Feb 25, 2009 at 6:44 AM, vanitha palanisamy <vanitha86@gmail.com> wrote:
Hi,

my code is

 protected void Page_Load(object sender, EventArgs e)
    {

        DataSet1 ds = new DataSet1();
        string strConn = ConfigurationManager.ConnectionStrings["BillDtsConnectionString"].ConnectionString;
        SqlConnection conn = new SqlConnection(strConn);
        string str = "select * from bill";
        SqlDataAdapter da = new SqlDataAdapter(str, conn);
        da.Fill(ds, "Bill");

        ReportDocument rptDoc = new ReportDocument();

        rptDoc.Load(Server.MapPath("CrystalReport1.rpt"));
        rptDoc.SetDataSource(ds.Tables["product"]);
     CrystalReportViewer1.ReportSource = rptDoc;
        CrystalReportViewer1.DataBind(); 
}

When i run this code am getting error as


Logon failed. Details: crdb_adoplus : Object reference not set to an instance of an object. Error in File C:\DOCUME~1\AS\LOCALS~1\Temp\

CrystalReport1 {786134AC-53BE-4210-9505-FC7F13188C03}.rpt: Unable to connect: incorrect log on parameters.

Can u say how to clear this one?






On Tue, Feb 24, 2009 at 9:01 PM, Manikandan .C <ec.manikanda@gmail.com> wrote:
Dear Vanitha
 
Are you created a object of Crystal report?
 
Then set file Properties of Crystal report object like as Database, etc
 
Manikandan.C

 
On 2/25/09, vanitha palanisamy <vanitha86@gmail.com> wrote:

Hi folks,

 

Am using crystal report in asp.net.Am dynamically creating dataset for crystal report.

But when i run the report am getting error as

 

Logon failed. Details: crdb_adoplus : Object reference not set to an instance of an object. Error in File C:\DOCUME~1\AS\LOCALS~1\Temp\CrystalReport1 {786134AC-53BE-4210-9505-FC7F13188C03}.rpt: Unable to connect: incorrect log on parameters.

 

Could anyone help?








--
R.Ram Mohan
Kuwait.
Mobile :-00965-94063743




--
R.Ram Mohan
Kuwait.
Mobile :-00965-94063743

[DotNetDevelopment] Re: Problem while Inserting with DataAdapter.

Yes Now i am understand ur problem and ur solution 2 ur problem
why i am sending this
ie BeginEdit/EndEdit this is pushed to change the row state

Now i am come to ur solution
Don't call acceptchanges method before Update

My sugg

what ever u can do with ur data table ie (new row
added,Modified,Deleted etc..)
then finaly call on single stmt
If Not DataTable.GetChanges Is Nothing Then adapter.Update
(DataTable.GetChanges)
DataTable.AcceptChanges()

On Feb 26, 11:13 pm, Bhargav Patel <bhargav.it...@gmail.com> wrote:
> Thanks for interest.
> But I cannot insert all the code in 1 mail because its spread among
> many files but im clearing main lines with following  steps.
>
> 1.I fill my table with query.
> 2.I Inserted new row in Grid and I got Inserted row.
>      dim row as datarow=grid.addnewrow.
> row("ID")=1
> After some more events.
> 3.row("ID")=5 'I Checked with another row values that row is same as above.
>
> 4.Then I saved the record with folowing code.
>    adapter.update(table)
>
> Main Point is it works fine most of  99% times , but cause problem
> only some times.
> I solved this problem by writing
>
> row.acceptchanges
> row.SetRowAdded
> adapter.Update(Table)
>
> But I want to know possible reason of this situation.
> Why dataadapter is not taking latest value to update datasource?
>
> On 2/26/09, Cerebrus <zorg...@sify.com> wrote:
>
>
>
>
>
> > Show us (the relevant part of) your code.
>
> > On Feb 26, 8:18 pm, "bhargav.it...@gmail.com"
> > <bhargav.it...@gmail.com> wrote:
> >> Hi Guys,
> >> Im Inserting row in Database with DataAdapter.Update(DataTable)
> >> method.
> >> Its working fine with No error.
>
> >> But Sometimes if I write like
>
> >> table.Row(i).Item("ColName")=5    ' My Previous  value is 1 and
> >> replacing with 5
>
> >> Here ,
> >> Current Value is  1
> >> Proposed Value Is 5
>
> >>  Then Execute  :
> >> DataAdapter.Update(Table)
>
> >> then execute Update  method of DataAdapter then
> >> It will Insert  '1' Instead of  '5'.
>
> >> From My reasearch I Found that Particular Items
> >> Current Value is Still 1 Before Update  and
> >> Proposed Value Is 5.
>
> >> What can be the problem?- Hide quoted text -
>
> - Show quoted text -

Regards
*******************
*C.Arun Kumar *
*******************

[DotNetDevelopment] Re: Problem while Inserting with DataAdapter.

Yes Now i am understand ur problem and ur solution 2 ur problem
why i am sending this
ie BeginEdit/EndEdit this is pushed to change the row state
 
Now i am come to ur solution
Don't call acceptchanges method before Update
 
My sugg
 
what ever u can do with ur data table ie (new row added,Modified,Deleted etc..)
then finaly call on single stmt

If

Not DataTable.GetChanges Is Nothing Then daBook.Update(DataTable.GetChanges)

DataTable.AcceptChanges()



2009/2/26 Bhargav Patel <bhargav.it.in@gmail.com>

Thanks for interest.
But I cannot insert all the code in 1 mail because its spread among
many files but im clearing main lines with following  steps.

1.I fill my table with query.
2.I Inserted new row in Grid and I got Inserted row.
    dim row as datarow=grid.addnewrow.
row("ID")=1
After some more events.
3.row("ID")=5 'I Checked with another row values that row is same as above.

4.Then I saved the record with folowing code.
  adapter.update(table)

Main Point is it works fine most of  99% times , but cause problem
only some times.
I solved this problem by writing

row.acceptchanges
row.SetRowAdded
adapter.Update(Table)

But I want to know possible reason of this situation.
Why dataadapter is not taking latest value to update datasource?








On 2/26/09, Cerebrus <zorg007@sify.com> wrote:
>
> Show us (the relevant part of) your code.
>
> On Feb 26, 8:18 pm, "bhargav.it...@gmail.com"
> <bhargav.it...@gmail.com> wrote:
>> Hi Guys,
>> Im Inserting row in Database with DataAdapter.Update(DataTable)
>> method.
>> Its working fine with No error.
>>
>> But Sometimes if I write like
>>
>> table.Row(i).Item("ColName")=5    ' My Previous  value is 1 and
>> replacing with 5
>>
>> Here ,
>> Current Value is  1
>> Proposed Value Is 5
>>
>>  Then Execute  :
>> DataAdapter.Update(Table)
>>
>> then execute Update  method of DataAdapter then
>> It will Insert  '1' Instead of  '5'.
>>
>> From My reasearch I Found that Particular Items
>> Current Value is Still 1 Before Update  and
>> Proposed Value Is 5.
>>
>> What can be the problem?



--
Regards
*******************
*C.Arun Kumar *
*******************
My Site
http://sites.google.com/site/carunkumar85/


[DotNetDevelopment] Re: saving any type file in sql server 2000 by asp.net

dear kamuni,
thanks alot for taking your time out for helping
me.
Regards,
Tahir Rameez

On Feb 26, 10:35 pm, Raghupathi Kamuni <raghukam...@gmail.com> wrote:
> Useful Linkshttp://www.dbazine.com/sql/sql-articles/charran5http://www.developer.com/net/asp/article.php/3761486http://aspnet.4guysfromrolla.com/articles/120606-1.aspx
>
> On Thu, Feb 26, 2009 at 12:40 PM, tahir rameez <tahir.ram...@gmail.com>wrote:
>
>
>
>
>
> > Please help me out, can any body give me compact solution to this
> > problem, also let me know what should be type of field of table, in
> > which file is to be stored.- Hide quoted text -
>
> - Show quoted text -

[DotNetDevelopment] Re: Question on ListView and CheckedItems property

Hmm.. thanks for letting us know. Sure had me wondering because
nothing was obviously wrong with the presented code. :-)

On Feb 27, 9:14 am, Tom <thass...@gmail.com> wrote:
> Never mind.  The code works fine.  I had another problem which caused
> this code to seem like it was not working.
>
> On Feb 25, 4:49 pm, Tom <thass...@gmail.com> wrote:
>
>
>
> > My application reads the file names in a folder and presents the data
> > in a ListView on a form.  The CheckBoxes property on the ListView is
> > true.  I want to process each file that the user has checked in the
> > ListView.  I am trying to use the following code:
>
> > ListView.CheckedListViewItemCollection checkedItems =
> > listView1.CheckedItems;
>
> > foreach(ListViewItem item in checkedItems)
> > {
> >      // processing logic
>
> > }
>
> > When I debug this code, the CheckedItems property and the Items
> > property in listView1 each contain zero elements.
>
> > My ListView is populated on the form, yet when I get to this method it
> > seems to be empty.  Was there some definition I had to do in order to
> > use it again?- Hide quoted text -
>
> - Show quoted text -

[DotNetDevelopment] Re: saving any type file in sql server 2000 by asp.net

And I would have appreciated a well worded, detailed question that
didn't keep the rest of us guessing about the problem.

On Feb 26, 10:16 pm, tahir rameez <tahir.ram...@gmail.com> wrote:
> i would have really appreciated if you answered my question rather
> then criticizing me.
>

[DotNetDevelopment] Re: saving any type file in sql server 2000 by asp.net

No can do!

On Feb 26, 10:14 pm, tahir rameez <tahir.ram...@gmail.com> wrote:
> spare me the sarcasm
>

[DotNetDevelopment] Re: Dropdown in datagrid

LOL !

On Feb 26, 10:09 pm, shini gupta <shini2...@gmail.com> wrote:
> just go infornt of mirror and thn ask, u willfind ur's ans.
>

[DotNetDevelopment] Re: Problem while Inserting with DataAdapter.

Just try it
 
table.Row(i).BeginEdit()
table.Row(i).Item("ColName")=5
table.Row(i).EndEdit()
 
' Then call
DataAdapter.Update(Table)
 


 
2009/2/26 bhargav.it.in@gmail.com <bhargav.it.in@gmail.com>

Hi Guys,
Im Inserting row in Database with DataAdapter.Update(DataTable)
method.
Its working fine with No error.

But Sometimes if I write like

table.Row(i).Item("ColName")=5    ' My Previous  value is 1 and
replacing with 5

Here ,
Current Value is  1
Proposed Value Is 5

 Then Execute  :
DataAdapter.Update(Table)

then execute Update  method of DataAdapter then
It will Insert  '1' Instead of  '5'.

From My reasearch I Found that Particular Items
Current Value is Still 1 Before Update  and
Proposed Value Is 5.

What can be the problem?






--
Regards
*******************
*C.Arun Kumar *
*******************



[DotNetDevelopment] Re: Regarding Crysta Report

Hi,

I tried both methods.
But still the problem remains constant.


On Wed, Feb 25, 2009 at 10:27 PM, Ram Mohan Rama Chandran <rammoghan@gmail.com> wrote:
hi...
 
try this
 
Its Setdatabaselogin(id,pw) , this part of the reportdocument class.
 
or 
 
 
  1. Open SQL Server Management Studio
  2. Select database engine (server) where database is created.
  3. Select "Security" folder. Followed by "Logins" folder.
  4. Check if there is "<server name>\ASPNET" as user exists.
    • If not then right click on "Logins" folder & select "New Login".
    • User "Search" button if you want to make sure correct username path is added to the "Logins" list.
 Crystal report uses ASPNET user hence SQL server must user login for ASPNET account.


On Thu, Feb 26, 2009 at 8:08 AM, vanitha palanisamy <vanitha86@gmail.com> wrote:
HI


I changed table name as "Bill" but still the problem remains constant.



On Wed, Feb 25, 2009 at 2:33 AM, Jackie <jasminmistry@gmail.com> wrote:
Hi Vanitha,

Your query is "Select * from Bill" but you are setting the datasource for table "Products" (in code: rptDoc.SetDataSource(ds.
Tables["product"])), so can you try changing it to "Bill". The error I think is bcoz the dataset doesn't have the products table.


Jasmin



On Wed, Feb 25, 2009 at 6:44 AM, vanitha palanisamy <vanitha86@gmail.com> wrote:
Hi,

my code is

 protected void Page_Load(object sender, EventArgs e)
    {

        DataSet1 ds = new DataSet1();
        string strConn = ConfigurationManager.ConnectionStrings["BillDtsConnectionString"].ConnectionString;
        SqlConnection conn = new SqlConnection(strConn);
        string str = "select * from bill";
        SqlDataAdapter da = new SqlDataAdapter(str, conn);
        da.Fill(ds, "Bill");

        ReportDocument rptDoc = new ReportDocument();

        rptDoc.Load(Server.MapPath("CrystalReport1.rpt"));
        rptDoc.SetDataSource(ds.Tables["product"]);
     CrystalReportViewer1.ReportSource = rptDoc;
        CrystalReportViewer1.DataBind(); 
}

When i run this code am getting error as


Logon failed. Details: crdb_adoplus : Object reference not set to an instance of an object. Error in File C:\DOCUME~1\AS\LOCALS~1\Temp\

CrystalReport1 {786134AC-53BE-4210-9505-FC7F13188C03}.rpt: Unable to connect: incorrect log on parameters.

Can u say how to clear this one?






On Tue, Feb 24, 2009 at 9:01 PM, Manikandan .C <ec.manikanda@gmail.com> wrote:
Dear Vanitha
 
Are you created a object of Crystal report?
 
Then set file Properties of Crystal report object like as Database, etc
 
Manikandan.C

 
On 2/25/09, vanitha palanisamy <vanitha86@gmail.com> wrote:

Hi folks,

 

Am using crystal report in asp.net.Am dynamically creating dataset for crystal report.

But when i run the report am getting error as

 

Logon failed. Details: crdb_adoplus : Object reference not set to an instance of an object. Error in File C:\DOCUME~1\AS\LOCALS~1\Temp\CrystalReport1 {786134AC-53BE-4210-9505-FC7F13188C03}.rpt: Unable to connect: incorrect log on parameters.

 

Could anyone help?








--
R.Ram Mohan
Kuwait.
Mobile :-00965-94063743

[DotNetDevelopment] Re: Question on ListView and CheckedItems property

Never mind. The code works fine. I had another problem which caused
this code to seem like it was not working.

On Feb 25, 4:49 pm, Tom <thass...@gmail.com> wrote:
> My application reads the file names in a folder and presents the data
> in a ListView on a form.  The CheckBoxes property on the ListView is
> true.  I want to process each file that the user has checked in the
> ListView.  I am trying to use the following code:
>
> ListView.CheckedListViewItemCollection checkedItems =
> listView1.CheckedItems;
>
> foreach(ListViewItem item in checkedItems)
> {
>      // processing logic
>
> }
>
> When I debug this code, the CheckedItems property and the Items
> property in listView1 each contain zero elements.
>
> My ListView is populated on the form, yet when I get to this method it
> seems to be empty.  Was there some definition I had to do in order to
> use it again?

[DotNetDevelopment] Change Width of TextBox in EditItemTemplate of GridView Control

Hi,

I was wondering if anyone can tell me how to change the width (at
runtime) of a textbox in the EditItem Template of the Gridview Control
in ASP.NET? I've tried various things but nothings seems to work. I
suspect this should be done in the rowediting event but I'm not sure.

Thanks In Advance,

Pete

[DotNetDevelopment] Server not working

I have a client part, which consist of 2 threads, one for reading from
a networkstream and one for writing to a networkstream, somehow my
reading does not work:
////Code

private static void readFromServer()
{
StreamReader sr = new StreamReader(clientStream);
while (true)
{
Console.WriteLine("Check if data is available");
if (clientStream.DataAvailable)
{
Console.WriteLine("Data was available");
while (sr.Peek() != -1)
{
Console.WriteLine("Starts to read:");
Console.WriteLine(sr.ReadToEnd());
Console.WriteLine("Done!");

}
}
Thread.Sleep(1000);
}
}

//// code

What's not working is the sr.ReadToEnd , I have also tried readline.
What works is sr.Read which reads but then the second time around(next
message) is not accepted, why is this?

Thank you in advance.

Thursday, February 26, 2009

[DotNetDevelopment] Re: Problem while Inserting with DataAdapter.

Thanks for interest.
But I cannot insert all the code in 1 mail because its spread among
many files but im clearing main lines with following steps.

1.I fill my table with query.
2.I Inserted new row in Grid and I got Inserted row.
dim row as datarow=grid.addnewrow.
row("ID")=1
After some more events.
3.row("ID")=5 'I Checked with another row values that row is same as above.

4.Then I saved the record with folowing code.
adapter.update(table)

Main Point is it works fine most of 99% times , but cause problem
only some times.
I solved this problem by writing

row.acceptchanges
row.SetRowAdded
adapter.Update(Table)

But I want to know possible reason of this situation.
Why dataadapter is not taking latest value to update datasource?


On 2/26/09, Cerebrus <zorg007@sify.com> wrote:
>
> Show us (the relevant part of) your code.
>
> On Feb 26, 8:18 pm, "bhargav.it...@gmail.com"
> <bhargav.it...@gmail.com> wrote:
>> Hi Guys,
>> Im Inserting row in Database with DataAdapter.Update(DataTable)
>> method.
>> Its working fine with No error.
>>
>> But Sometimes if I write like
>>
>> table.Row(i).Item("ColName")=5    ' My Previous  value is 1 and
>> replacing with 5
>>
>> Here ,
>> Current Value is  1
>> Proposed Value Is 5
>>
>>  Then Execute  :
>> DataAdapter.Update(Table)
>>
>> then execute Update  method of DataAdapter then
>> It will Insert  '1' Instead of  '5'.
>>
>> From My reasearch I Found that Particular Items
>> Current Value is Still 1 Before Update  and
>> Proposed Value Is 5.
>>
>> What can be the problem?

[DotNetDevelopment] Re: saving any type file in sql server 2000 by asp.net

Useful Links


 
On Thu, Feb 26, 2009 at 12:40 PM, tahir rameez <tahir.rameez@gmail.com> wrote:

Please help me out, can any body give me compact solution to this
problem, also let me know what should be type of field of table, in
which file is to be stored.

[DotNetDevelopment] Re: saving any type file in sql server 2000 by asp.net

i would have really appreciated if you answered my question rather
then criticizing me.

On Feb 26, 4:03 pm, Cerebrus <zorg...@sify.com> wrote:
> Answer one question - What is the functional difference between a
> subject line and a message body? Do you believe it's a waste of your
> precious time to elaborate on the title?
>
> On Feb 26, 12:10 pm, tahir rameez <tahir.ram...@gmail.com> wrote:
>
> > Please help me out, can any body give me compact solution to this
> > problem, also let me know what should be type of field of table, in
> > which file is to be stored.

[DotNetDevelopment] Re: saving any type file in sql server 2000 by asp.net

spare me the sarcasm

On Feb 26, 4:03 pm, Cerebrus <zorg...@sify.com> wrote:
> Answer one question - What is the functional difference between a
> subject line and a message body? Do you believe it's a waste of your
> precious time to elaborate on the title?
>
> On Feb 26, 12:10 pm, tahir rameez <tahir.ram...@gmail.com> wrote:
>
> > Please help me out, can any body give me compact solution to this
> > problem, also let me know what should be type of field of table, in
> > which file is to be stored.

[DotNetDevelopment] Re: Dropdown in datagrid

just go infornt of mirror and thn ask, u willfind ur's ans.

On 2/26/09, Drew Crawford <atcrawford@gmail.com> wrote:
who am I?


On Wed, Feb 25, 2009 at 1:26 PM, Cerebrus <zorg007@sify.com> wrote:

It's a post. A discussion thread is composed of individual posts. In
other words, a discussion thread is a generic collection of type Post.

---
List<Post> discussionThread = new List<Post>();
---

;-)

On Feb 25, 10:54 pm, shini gupta <shini2...@gmail.com> wrote:
> what is this?
>
 
> On 2/25/09, Cerebrus <zorg...@sify.com> wrote:
>
> > Lol! I like guys with a sense of humour. :-)
>
 


[DotNetDevelopment] Re: Grid View Problem

hi,
  if u want tht first timeur's checkbok will be chaecked thn simply set default value of checkbox checked.

 
On 2/26/09, Jeena Ajiesh <jeenajos@gmail.com> wrote:
Ya,Once i clicked the buton,all the student details along with their class should be diplayed in datagrid.Atthe same time the check box should be checked at the first time.Then i an make changes to the check box, based upon the students present in the class. If he is present, then the check box should be checked else unchecked.
Hope u got my point..

 
On Wed, Feb 25, 2009 at 6:51 PM, The_Fruitman <evilfruitsmasher@gmail.com> wrote:

What would happen if in your initial retrieval of the data you set all
the attendance values to true in your dataset, just before you
databind it to the grid?  Would that accomplish what you need to do?

On Feb 25, 6:06 am, Jeena Ajiesh <jeena...@gmail.com> wrote:
> Hi all,
> I have a grid that displays the student name, class and a checkbox for the
> attendance.
> Wen i click add new button, it should retrieve all student name and class
> and all the check box in the grid should be checked.
> This checkbox should be uncheck if needed. and based on the checkbox value
> the attendance is marked.
>
> Can anyone give some idea for this problem.
> I'm doing my project in asp.net, vs 2005.
>
> Eg: Studentname     Class      Attendance
>         aaaa                I A              * (checkbox)
>          bbb                 IA               * (checkbox)
>
> At button click it all details should be bind in grid and along with
> attendance should be " * "
> Later as my need i can uncheck too..
>
> Any Idea???
>
> --
> ****************
> Regards,
> ♪♥♫♥Ĵєєήǎ ♫♥♪♥
 
> Email: jeena....@hotmail.com
>          jeena...@gmail.com
>          jeena007...@yahoo.co.in



--
****************
Regards,
♪♥♫♥Ĵєєήǎ ♫♥♪♥
Email: jeena.jos@hotmail.com
         jeenajos@gmail.com
         jeena007_jk@yahoo.co.in


[DotNetDevelopment] CryptoStream returns bad data only on some machines

I have an application that uses CryptoStream to encrypt and decrypt
strings and stores and retrieves these values from a SQLServer
database.

When I run the application on my machine I can decrypt all the strings
in the database. When I run from a server I get "Bad Data" errors when
I try to close my CryptoStream.

Here is a sample application that I threw together:

using System;
using System.Collections;
using System.Text;
using System.Security.Cryptography;
using System.IO;

namespace myTest
{
class Program
{
private static byte[] byteToken;

static void Main( string[] args )
{
Console.WriteLine( "Decoding sample string:" );

string testtoken = "mGAETZOUuW5tjFR4ihp80D23JQg4Uhtfdq
+UjZlBOE9XIRVvi+FtKg3R7TygdTEOjG+Qj6SLXl24fng+vuubLzK1vX1igECVQV
+9KKDjWpSG82S
+GTVOMsButxrae1bN83XdcFV0TN82iBW3Er4fKFfYSgAwyNEDCtrKO1hbbInLD0Z5ktzNB
+pfU4JVOVKAUbSPjIt4/8Na8HJimxleF6q/0SmRL0EOiyJRMT1xrKSHBK2VY/
rJnMicl053U+J1ZDGcHbUBPY1Z+
+dd0cfgKD79t6N0QJLzyPeuRVjmobT6lxznalAxgp5g0IXQugsMHuWeBR/zl/yey/
+h5dHPoK5XRGs56F+P";

Console.WriteLine( DecryptDES( testtoken ) );

Console.WriteLine( "Creating new string:" );

string tmpToken = EncryptDES( RandomString( 64, 64 ) );

Console.WriteLine( tmpToken );

Console.WriteLine( "Decoding new string:" );

Console.WriteLine( DecryptDES( tmpToken ) );
}


#region Encryption Methods
private static string RandomToken()
{
byte[] randombytes = new byte[128];

RNGCryptoServiceProvider Gen = new RNGCryptoServiceProvider
();
Gen.GetBytes( randombytes );
byteToken = randombytes;

return Encoding.Unicode.GetString( randombytes );
}

public static string RandomString( int minLength, int
maxLength )
{

string PASSWORD_CHARS_LCASE = "abcdefgijkmnopqrstwxyz";
string PASSWORD_CHARS_UCASE = "ABCDEFGHJKLMNPQRSTWXYZ";
string PASSWORD_CHARS_NUMERIC = "123456789";
string PASSWORD_CHARS_SPECIAL = "*$-+?_&=!{}";

// Create a local array containing supported password
characters
// grouped by types. You can remove character groups from
this
// array, but doing so will weaken the password strength.
char[][] charGroups = new char[][]
{
PASSWORD_CHARS_LCASE.ToCharArray(),
PASSWORD_CHARS_UCASE.ToCharArray(),
PASSWORD_CHARS_NUMERIC.ToCharArray(),
PASSWORD_CHARS_SPECIAL.ToCharArray()
};

// Use this array to track the number of unused characters
in each
// character group.
int[] charsLeftInGroup = new int[charGroups.Length];

// Initially, all characters in each group are not used.
for( int i = 0; i < charsLeftInGroup.Length; i++ )
charsLeftInGroup[i] = charGroups[i].Length;

// Use this array to track (iterate through) unused
character groups.
int[] leftGroupsOrder = new int[charGroups.Length];

// Initially, all character groups are not used.
for( int i = 0; i < leftGroupsOrder.Length; i++ )
leftGroupsOrder[i] = i;

// Because we cannot use the default randomizer, which is
based on the
// current time (it will produce the same "random" number
within a
// second), we will use a random number generator to seed
the
// randomizer.

// Use a 4-byte array to fill it with random bytes and
convert it then
// to an integer value.
byte[] randomBytes = new byte[4];

// Generate 4 random bytes.
RNGCryptoServiceProvider rng = new RNGCryptoServiceProvider
();
rng.GetBytes( randomBytes );

// Convert 4 bytes into a 32-bit integer value.
int seed = ( randomBytes[0] & 0x7f ) << 24 |
randomBytes[1] << 16 |
randomBytes[2] << 8 |
randomBytes[3];

// Now, this is real randomization.
Random random = new Random( seed );
// This array will hold password characters.
char[] password = null;
// Allocate appropriate memory for the password.
if( minLength < maxLength )
password = new char[random.Next( minLength, maxLength
+ 1 )];
else
password = new char[minLength];

// Index of the next character to be added to password.
int nextCharIdx;
// Index of the next character group to be processed.
int nextGroupIdx;
// Index which will be used to track not processed
character groups.
int nextLeftGroupsOrderIdx;
// Index of the last non-processed character in a group.
int lastCharIdx;
// Index of the last non-processed group.
int lastLeftGroupsOrderIdx = leftGroupsOrder.Length - 1;

// Generate password characters one at a time.
for( int i = 0; i < password.Length; i++ )
{
// If only one character group remained unprocessed,
process it;
// otherwise, pick a random character group from the
unprocessed
// group list. To allow a special character to appear
in the
// first position, increment the second parameter of
the Next
// function call by one, i.e. lastLeftGroupsOrderIdx +
1.
if( lastLeftGroupsOrderIdx == 0 )
nextLeftGroupsOrderIdx = 0;
else
nextLeftGroupsOrderIdx = random.Next( 0,
lastLeftGroupsOrderIdx );

// Get the actual index of the character group, from
which we will
// pick the next character.
nextGroupIdx = leftGroupsOrder
[nextLeftGroupsOrderIdx];
// Get the index of the last unprocessed characters in
this group.
lastCharIdx = charsLeftInGroup[nextGroupIdx] - 1;
// If only one unprocessed character is left, pick it;
otherwise,
// get a random character from the unused character
list.
if( lastCharIdx == 0 )
nextCharIdx = 0;
else
nextCharIdx = random.Next( 0, lastCharIdx + 1 );

// Add this character to the password.
password[i] = charGroups[nextGroupIdx][nextCharIdx];

// If we processed the last character in this group,
start over.
if( lastCharIdx == 0 )
charsLeftInGroup[nextGroupIdx] = charGroups
[nextGroupIdx].Length;
// There are more unprocessed characters left.
else
{
// Swap processed character with the last
unprocessed character
// so that we don't pick it until we process all
characters in
// this group.
if( lastCharIdx != nextCharIdx )
{
char temp = charGroups[nextGroupIdx]
[lastCharIdx];
charGroups[nextGroupIdx][lastCharIdx] =
charGroups[nextGroupIdx][nextCharIdx];
charGroups[nextGroupIdx][nextCharIdx] = temp;
}
// Decrement the number of unprocessed characters
in
// this group.
charsLeftInGroup[nextGroupIdx]--;
}

// If we processed the last group, start all over.
if( lastLeftGroupsOrderIdx == 0 )
lastLeftGroupsOrderIdx = leftGroupsOrder.Length -
1;
// There are more unprocessed groups left.
else
{
// Swap processed group with the last unprocessed
group
// so that we don't pick it until we process all
groups.
if( lastLeftGroupsOrderIdx !=
nextLeftGroupsOrderIdx )
{
int temp = leftGroupsOrder
[lastLeftGroupsOrderIdx];
leftGroupsOrder[lastLeftGroupsOrderIdx] =
leftGroupsOrder[nextLeftGroupsOrderIdx];
leftGroupsOrder[nextLeftGroupsOrderIdx] =
temp;
}
// Decrement the number of unprocessed groups.
lastLeftGroupsOrderIdx--;
}
}
// Convert password characters into a string and return
the result.
return new string( password );

}

public static byte[] EncryptDES( byte[] clearData, byte[] Key,
byte[] IV )
{

MemoryStream ms = new MemoryStream();

TripleDES tripDES = TripleDES.Create();

tripDES.Key = Key;
tripDES.IV = IV;

CryptoStream cs = new CryptoStream( ms,
tripDES.CreateEncryptor(), CryptoStreamMode.Write );

cs.Write( clearData, 0, clearData.Length );

cs.Close();
ms.Close();

byte[] encryptedData = ms.ToArray();

byte[] testbyte = new byte[byteToken.Length +
encryptedData.Length];
byteToken.CopyTo( testbyte, 0 );
encryptedData.CopyTo( testbyte, byteToken.Length );


return testbyte;
}

public static string EncryptDES( string clearText )
{

byte[] clearBytes = Encoding.Unicode.GetBytes
( clearText );

Rfc2898DeriveBytes pdb = new Rfc2898DeriveBytes
( RandomToken(),
new byte[] { 0xe3, 0xe4, 0xed, 0x43, 0x6e, 0x74, 0x72,
0x61, 0x2e, 0x6d, 0x65, 0x6c,
0x4c, 0x6f, 0x6e, 0x62, 0x41, 0x4e,
0x6b, 0x2e, 0x43,
0x6f, 0x6d, 0x5c, 0x52, 0x50, 0x4e,
0x73, 0x53, 0xe3, 0xe4, 0xed} );

byte[] encryptedData = EncryptDES( clearBytes, pdb.GetBytes
( 24 ), pdb.GetBytes( 8 ) );

return Convert.ToBase64String( encryptedData );
}

[DotNetDevelopment] Re: Problem while Inserting with DataAdapter.

Show us (the relevant part of) your code.

On Feb 26, 8:18 pm, "bhargav.it...@gmail.com"
<bhargav.it...@gmail.com> wrote:
> Hi Guys,
> Im Inserting row in Database with DataAdapter.Update(DataTable)
> method.
> Its working fine with No error.
>
> But Sometimes if I write like
>
> table.Row(i).Item("ColName")=5    ' My Previous  value is 1 and
> replacing with 5
>
> Here ,
> Current Value is  1
> Proposed Value Is 5
>
>  Then Execute  :
> DataAdapter.Update(Table)
>
> then execute Update  method of DataAdapter then
> It will Insert  '1' Instead of  '5'.
>
> From My reasearch I Found that Particular Items
> Current Value is Still 1 Before Update  and
> Proposed Value Is 5.
>
> What can be the problem?

[DotNetDevelopment] CryptoStream returns bad data only on some machines

I have an application that uses CryptoStream to encrypt and decrypt
strings and stores and retrieves these values from a SQLServer
database.

When I run the application on my machine I can decrypt all the strings
in the database. When I run from a server I get "Bad Data" errors when
I try to close my CryptoStream.

Here is a sample application that I threw together:

using System;
using System.Collections;
using System.Text;
using System.Security.Cryptography;
using System.IO;

namespace myTest
{
class Program
{
private static byte[] byteToken;

static void Main( string[] args )
{
Console.WriteLine( "Decoding sample string:" );

string testtoken = "mGAETZOUuW5tjFR4ihp80D23JQg4Uhtfdq
+UjZlBOE9XIRVvi+FtKg3R7TygdTEOjG+Qj6SLXl24fng+vuubLzK1vX1igECVQV
+9KKDjWpSG82S
+GTVOMsButxrae1bN83XdcFV0TN82iBW3Er4fKFfYSgAwyNEDCtrKO1hbbInLD0Z5ktzNB
+pfU4JVOVKAUbSPjIt4/8Na8HJimxleF6q/0SmRL0EOiyJRMT1xrKSHBK2VY/
rJnMicl053U+J1ZDGcHbUBPY1Z+
+dd0cfgKD79t6N0QJLzyPeuRVjmobT6lxznalAxgp5g0IXQugsMHuWeBR/zl/yey/
+h5dHPoK5XRGs56F+P";

Console.WriteLine( DecryptDES( testtoken ) );

Console.WriteLine( "Creating new string:" );

string tmpToken = EncryptDES( RandomString( 64, 64 ) );

Console.WriteLine( tmpToken );

Console.WriteLine( "Decoding new string:" );

Console.WriteLine( DecryptDES( tmpToken ) );
}


#region Encryption Methods
private static string RandomToken()
{
byte[] randombytes = new byte[128];

RNGCryptoServiceProvider Gen = new RNGCryptoServiceProvider
();
Gen.GetBytes( randombytes );
byteToken = randombytes;

return Encoding.Unicode.GetString( randombytes );
}

public static string RandomString( int minLength, int
maxLength )
{

string PASSWORD_CHARS_LCASE = "abcdefgijkmnopqrstwxyz";
string PASSWORD_CHARS_UCASE = "ABCDEFGHJKLMNPQRSTWXYZ";
string PASSWORD_CHARS_NUMERIC = "123456789";
string PASSWORD_CHARS_SPECIAL = "*$-+?_&=!{}";

// Create a local array containing supported password
characters
// grouped by types. You can remove character groups from
this
// array, but doing so will weaken the password strength.
char[][] charGroups = new char[][]
{
PASSWORD_CHARS_LCASE.ToCharArray(),
PASSWORD_CHARS_UCASE.ToCharArray(),
PASSWORD_CHARS_NUMERIC.ToCharArray(),
PASSWORD_CHARS_SPECIAL.ToCharArray()
};

// Use this array to track the number of unused characters
in each
// character group.
int[] charsLeftInGroup = new int[charGroups.Length];

// Initially, all characters in each group are not used.
for( int i = 0; i < charsLeftInGroup.Length; i++ )
charsLeftInGroup[i] = charGroups[i].Length;

// Use this array to track (iterate through) unused
character groups.
int[] leftGroupsOrder = new int[charGroups.Length];

// Initially, all character groups are not used.
for( int i = 0; i < leftGroupsOrder.Length; i++ )
leftGroupsOrder[i] = i;

// Because we cannot use the default randomizer, which is
based on the
// current time (it will produce the same "random" number
within a
// second), we will use a random number generator to seed
the
// randomizer.

// Use a 4-byte array to fill it with random bytes and
convert it then
// to an integer value.
byte[] randomBytes = new byte[4];

// Generate 4 random bytes.
RNGCryptoServiceProvider rng = new RNGCryptoServiceProvider
();
rng.GetBytes( randomBytes );

// Convert 4 bytes into a 32-bit integer value.
int seed = ( randomBytes[0] & 0x7f ) << 24 |
randomBytes[1] << 16 |
randomBytes[2] << 8 |
randomBytes[3];

// Now, this is real randomization.
Random random = new Random( seed );
// This array will hold password characters.
char[] password = null;
// Allocate appropriate memory for the password.
if( minLength < maxLength )
password = new char[random.Next( minLength, maxLength
+ 1 )];
else
password = new char[minLength];

// Index of the next character to be added to password.
int nextCharIdx;
// Index of the next character group to be processed.
int nextGroupIdx;
// Index which will be used to track not processed
character groups.
int nextLeftGroupsOrderIdx;
// Index of the last non-processed character in a group.
int lastCharIdx;
// Index of the last non-processed group.
int lastLeftGroupsOrderIdx = leftGroupsOrder.Length - 1;

// Generate password characters one at a time.
for( int i = 0; i < password.Length; i++ )
{
// If only one character group remained unprocessed,
process it;
// otherwise, pick a random character group from the
unprocessed
// group list. To allow a special character to appear
in the
// first position, increment the second parameter of
the Next
// function call by one, i.e. lastLeftGroupsOrderIdx +
1.
if( lastLeftGroupsOrderIdx == 0 )
nextLeftGroupsOrderIdx = 0;
else
nextLeftGroupsOrderIdx = random.Next( 0,
lastLeftGroupsOrderIdx );

// Get the actual index of the character group, from
which we will
// pick the next character.
nextGroupIdx = leftGroupsOrder
[nextLeftGroupsOrderIdx];
// Get the index of the last unprocessed characters in
this group.
lastCharIdx = charsLeftInGroup[nextGroupIdx] - 1;
// If only one unprocessed character is left, pick it;
otherwise,
// get a random character from the unused character
list.
if( lastCharIdx == 0 )
nextCharIdx = 0;
else
nextCharIdx = random.Next( 0, lastCharIdx + 1 );

// Add this character to the password.
password[i] = charGroups[nextGroupIdx][nextCharIdx];

// If we processed the last character in this group,
start over.
if( lastCharIdx == 0 )
charsLeftInGroup[nextGroupIdx] = charGroups
[nextGroupIdx].Length;
// There are more unprocessed characters left.
else
{
// Swap processed character with the last
unprocessed character
// so that we don't pick it until we process all
characters in
// this group.
if( lastCharIdx != nextCharIdx )
{
char temp = charGroups[nextGroupIdx]
[lastCharIdx];
charGroups[nextGroupIdx][lastCharIdx] =
charGroups[nextGroupIdx][nextCharIdx];
charGroups[nextGroupIdx][nextCharIdx] = temp;
}
// Decrement the number of unprocessed characters
in
// this group.
charsLeftInGroup[nextGroupIdx]--;
}

// If we processed the last group, start all over.
if( lastLeftGroupsOrderIdx == 0 )
lastLeftGroupsOrderIdx = leftGroupsOrder.Length -
1;
// There are more unprocessed groups left.
else
{
// Swap processed group with the last unprocessed
group
// so that we don't pick it until we process all
groups.
if( lastLeftGroupsOrderIdx !=
nextLeftGroupsOrderIdx )
{
int temp = leftGroupsOrder
[lastLeftGroupsOrderIdx];
leftGroupsOrder[lastLeftGroupsOrderIdx] =
leftGroupsOrder[nextLeftGroupsOrderIdx];
leftGroupsOrder[nextLeftGroupsOrderIdx] =
temp;
}
// Decrement the number of unprocessed groups.
lastLeftGroupsOrderIdx--;
}
}
// Convert password characters into a string and return
the result.
return new string( password );

}

public static byte[] EncryptDES( byte[] clearData, byte[] Key,
byte[] IV )
{

MemoryStream ms = new MemoryStream();

TripleDES tripDES = TripleDES.Create();

tripDES.Key = Key;
tripDES.IV = IV;

CryptoStream cs = new CryptoStream( ms,
tripDES.CreateEncryptor(), CryptoStreamMode.Write );

cs.Write( clearData, 0, clearData.Length );

cs.Close();
ms.Close();

byte[] encryptedData = ms.ToArray();

byte[] testbyte = new byte[byteToken.Length +
encryptedData.Length];
byteToken.CopyTo( testbyte, 0 );
encryptedData.CopyTo( testbyte, byteToken.Length );


return testbyte;
}

public static string EncryptDES( string clearText )
{

byte[] clearBytes = Encoding.Unicode.GetBytes
( clearText );

Rfc2898DeriveBytes pdb = new Rfc2898DeriveBytes
( RandomToken(),
new byte[] { 0xe3, 0xe4, 0xed, 0x43, 0x6e, 0x74, 0x72,
0x61, 0x2e, 0x6d, 0x65, 0x6c,
0x4c, 0x6f, 0x6e, 0x62, 0x41, 0x4e,
0x6b, 0x2e, 0x43,
0x6f, 0x6d, 0x5c, 0x52, 0x50, 0x4e,
0x73, 0x53, 0xe3, 0xe4, 0xed} );

byte[] encryptedData = EncryptDES( clearBytes, pdb.GetBytes
( 24 ), pdb.GetBytes( 8 ) );

return Convert.ToBase64String( encryptedData );
}

[DotNetDevelopment] Re: saving any type file in sql server 2000 by asp.net

Answer one question - What is the functional difference between a
subject line and a message body? Do you believe it's a waste of your
precious time to elaborate on the title?

On Feb 26, 12:10 pm, tahir rameez <tahir.ram...@gmail.com> wrote:
> Please help me out, can any body give me compact solution to this
> problem, also let me know what should be type of field of table, in
> which file is to be stored.

[DotNetDevelopment] Re: VB.NET - Search for all strings starting with number and ending with a few character say E, W

Ok you can try Regular expression
or take the first character of every string and check with isnumeric();
But I thing Regualar Expression is the best way to do this.

On Tue, Feb 24, 2009 at 9:12 PM, Cerebrus <zorg007@sify.com> wrote:

There is obviously no in-built function to do this, but writing code
to do it should be simple enough.

Unfortunately, you have provided no details or sample data. In
addition, you appear to have made no effort in the direction of
solving the problem, instead choosing to depend completely on someone
else to do your homework for you. As if that were not irritating
enough, you expect us to "mail" you the solution.

We provide free help in this forum but that also means that we are
discerning about exactly who deserves to be helped.

On Feb 24, 4:43 pm, maddie <catchm...@gmail.com> wrote:
> Is there any function available to pick up all the strings starting
> with number and ending with few selected character  . We have a
> requirement to do the same using VB.net .
>
> Please mail how to do it.
> Thanks in advance

[DotNetDevelopment] Problem while Inserting with DataAdapter.

Hi Guys,
Im Inserting row in Database with DataAdapter.Update(DataTable)
method.
Its working fine with No error.

But Sometimes if I write like

table.Row(i).Item("ColName")=5 ' My Previous value is 1 and
replacing with 5

Here ,
Current Value is 1
Proposed Value Is 5

Then Execute :
DataAdapter.Update(Table)

then execute Update method of DataAdapter then
It will Insert '1' Instead of '5'.

From My reasearch I Found that Particular Items
Current Value is Still 1 Before Update and
Proposed Value Is 5.

What can be the problem?

[DotNetDevelopment] Re: Suche .NET-Seminar zum Thema "Best Practice Design von Forms Anwendungen"

This is an English speaking forum, but from what I can remember of
German it seems that you are looking for a best practice seminar on
windows forms.

http://www.google.com/search?hl=en&q=windows+forms+best+practice+design

On Feb 26, 4:19 am, MacGyverX <macgyver...@googlemail.com> wrote:
> Hallo zusammen,
>
> ich suche zu oben genanntem Thema ein Seminar, um entsprechendes Know-
> How aufzubauen. Leider finde ich im Netz nicht wirklich was
> sinnvolles, wenn ich nach den einzelenen Begriffen googele.
>
> Hat jemand von euch vielleicht einen Tipp, wo ich da mal nachsehen
> kann.
>
> Danke im Voraus.
>
> Gruß,
> MacGyverX

[DotNetDevelopment] Re: Regarding Crysta Report

Ok Man,

try Out cr.Database.SetLogonInfo
and give username and password you given at time of creating crystal
report.


On Feb 26, 11:27 am, Ram Mohan Rama Chandran <rammog...@gmail.com>
wrote:
> hi...
>
> try this
>
> Its Setdatabaselogin(id,pw) , this part of the reportdocument class.
>
> or
>
>    1. Open SQL Server Management Studio
>    2. Select database engine (server) where database is created.
>    3. Select "Security" folder. Followed by "Logins" folder.
>    4. Check if there is "<server name>\ASPNET" as user exists.
>       - If not then right click on "Logins" folder & select "New Login".
>       - User "Search" button if you want to make sure correct username path
>       is added to the "Logins" list.
>
>  Crystal report uses ASPNET user hence SQL server must user login for ASPNET
> account.
>
> On Thu, Feb 26, 2009 at 8:08 AM, vanitha palanisamy <vanith...@gmail.com>wrote:
>
>
>
>
>
> > HI
>
> > I changed table name as *"Bill"* but still the problem remains constant.
>
> > On Wed, Feb 25, 2009 at 2:33 AM, Jackie <jasminmis...@gmail.com> wrote:
>
> >> Hi Vanitha,
>
> >> Your query is "Select * from Bill" but you are setting the datasource for
> >> table "Products" (in code: rptDoc.SetDataSource(ds.
>
> >>> Tables["*product*"])), so can you try changing it to "Bill". The error I
> >>> think is bcoz the dataset doesn't have the products table.
>
> >> *
> >> Jasmin*
>
> >> On Wed, Feb 25, 2009 at 6:44 AM, vanitha palanisamy <vanith...@gmail.com>wrote:
>
> >>> Hi,
>
> >>> my code is
>
> >>>  protected void Page_Load(object sender, EventArgs e)
> >>>     {
>
> >>>         DataSet1 ds = new DataSet1();
> >>>         string strConn =
> >>> ConfigurationManager.ConnectionStrings["BillDtsConnectionString"].Connectio­nString;
> >>>         SqlConnection conn = new SqlConnection(strConn);
> >>>         string str = "select * from bill";
> >>>         SqlDataAdapter da = new SqlDataAdapter(str, conn);
> >>>         da.Fill(ds, "Bill");
>
> >>>         ReportDocument rptDoc = new ReportDocument();
>
> >>>         rptDoc.Load(Server.MapPath("CrystalReport1.rpt"));
> >>>         rptDoc.SetDataSource(ds.Tables["product"]);
> >>>      CrystalReportViewer1.ReportSource = rptDoc;
> >>>         CrystalReportViewer1.DataBind();
> >>> }
>
> >>> When i run this code am getting error as
>
> >>> Logon failed. Details: crdb_adoplus : Object reference not set to an
> >>> instance of an object. Error in File C:\DOCUME~1\AS\LOCALS~1\Temp\
>
> >>> CrystalReport1 {786134AC-53BE-4210-9505-FC7F13188C03}.rpt: Unable to
> >>> connect: incorrect log on parameters.
>
> >>> Can u say how to clear this one?
>
> >>> On Tue, Feb 24, 2009 at 9:01 PM, Manikandan .C <ec.manika...@gmail.com>wrote:
>
> >>>> Dear Vanitha
>
> >>>> Are you created a object of Crystal report?
>
> >>>> Then set file Properties of Crystal report object like as Database, etc
>
> >>>> Manikandan.C
>
> >>>>   On 2/25/09, vanitha palanisamy <vanith...@gmail.com> wrote:
>
> >>>>> Hi folks,
>
> >>>>> Am using crystal report in asp.net.Am <http://asp.net.am/> dynamically
> >>>>> creating dataset for crystal report.
>
> >>>>> But when i run the report am getting error as
>
> >>>>> Logon failed. Details: crdb_adoplus : Object reference not set to an
> >>>>> instance of an object. Error in File
> >>>>> C:\DOCUME~1\AS\LOCALS~1\Temp\CrystalReport1
> >>>>> {786134AC-53BE-4210-9505-FC7F13188C03}.rpt: Unable to connect: incorrect log
> >>>>> on parameters.
>
> >>>>> Could anyone help?
>
> --
> R.Ram Mohan
> Kuwait.
> Mobile :-00965-94063743- Hide quoted text -
>
> - Show quoted text -