|
Im gonna guess that something went wrong when you tried to fill your dataset, or ProjectidList was not initialised properly.
Add an if statement to see if either of them are null or something.
My current favourite word is: PIE!
Good ol' pie, it's been a while.
|
|
|
|
|
Two reasons:
1) Are you missing a runat="server" for ProjectidList in the ASPX page?
2) Is ds null?
Vasudevan Deepak Kumar
Personal Homepage Tech Gossips
A pessimist sees only the dark side of the clouds, and mopes; a philosopher sees both sides, and shrugs; an optimist doesn't see the clouds at all - he's walking on them. --Leonard Louis Levinson
|
|
|
|
|
Before,
adapter.Fill(ds, "Project_ID");
, open your connection ,
conn.Open();
While you forgot this the dataset is null so as it says object reference not set to an instance of an object.
Regards.
.:: Something is Wrong ::.
|
|
|
|
|
Hy!
How can i disable the print button from a PDF file using C#, if there is a way to do it? I'm using Visual-Studio 2003, .NET Framework 1.1
Thanks!
|
|
|
|
|
|
Weeeelllll.............., i need to disable that print button automatically, so i suppose i need some kind of code to do this.
Thanks anyway!
|
|
|
|
|
Well, there's no way to do that. The security dictating what the client side can and cannot do with the PDF document, including printing it, is saved in the document itself. Your ASP.NET code, which runs entirely server-side only, cannot modify the interface of the client.
|
|
|
|
|
I see......!
Thanks for being so promptly!
|
|
|
|
|
Hello all,
I have a .NET 2.0 remoting service that listens on various URIs for requests, all well and good and it works perfectly.
However I would like to add functionality that displays a custom message should somebody telnet to the listening port.
Currently if somebody does this the following is displayed:
.NET☺☻☻♥☺♥☺☺hServer encountered an internal error. To get more info turn on cust
omErrors in the server's config file.
I would like to display something like this:
My Widget Application v1.0
blah blah blah something about usage blah blah something about auditing blah blah blah
What complicates this even further is the fact that the tcp channel is registered with a compression and encryption sink. Obviously a simple command line telnet connection is not going to send any data that is either compressed or encrypted, so I need this to bypass the sinks.
So does anybody know how to do this?
-- modified at 9:13 Friday 23rd November, 2007
|
|
|
|
|
1] how do i call an managed code from an unmanaged code .....
2] similarly is there any other way of embedding an unmanaged code in managed code without creating a DLL
Regards ,
Amol Jain
It Ain't Over ,Till It's Over
|
|
|
|
|
It depends on what you mean by unmanaged code. You could use the unsafe keyword to allow you to interact with pointers, or you can use P/Invoke to interact with pointer based code - see the site http://www.pinvoke.net/[^] for examples.
|
|
|
|
|
I have been trying to work out a synchronization mechnaism in C# using syncroot property of collections. I used a StringCollection class as an example to see what will happen in my code. Here is my Console application code:
namespace synctest
{
class Program
{
static StringCollection mycol = new StringCollection();
static void Main(string[] args)
{
for (int i = 0; i < 1000; i++)
{
mycol.Add(i.ToString());
}
Thread t1 = new Thread(Disp);
Thread t2 = new Thread(Manip);
t1.Start();
Thread.Sleep(10);
t2.Start();
Console.ReadLine();
}
static void Disp()
{
lock (mycol.SyncRoot)
{
for (int i = 0; i < 1000; i++)
{
Console.Write(mycol[i] + "-");
}
}
}
static void Manip()
{
for (int i = 0; i < 1000; i++)
{
mycol[i] = (i*2).ToString();
}
}
}
}
One thread displays the collection items while the other one tries to multiply the integer representation of each itme by 2. In my test, I expected the multiplier thread to wait for the first thread to finish its job, but i noticed that after number 20, all the displayed numbers were multiplied by 2. This means that the threads have overlapped and although I have used lock on the collection's syncroot property, the problem of concurrency still happens. Any clue?
|
|
|
|
|
hamidkhan wrote: and although I have used lock on the collection's syncroot property,
Doesn't seem so, looking at your code.
static void Manip()
{
for (int i = 0; i < 1000; i++)
{
mycol[i] = (i*2).ToString();
}
}
You should add a lock there. And please use the pre tags when posting source code.
Standards are great! Everybody should have one!
|
|
|
|
|
Hi,
I get the following error:
'System.Web.UI.WebControls.DropDownList' does not contain a definition for 'DatatValueField'
My code :
string sqlStmt = null;
sqlStmt = "GetProjest";//stored proc
SqlCommand cmd = new SqlCommand();
cmd.CommandText = sqlStmt;
cmd.CommandType = CommandType.StoredProcedure;
SqlDataReader sqlReader = cmd.ExecuteReader();
if(sqlReader.HasRows)
{
ProjectidList.DataSource = sqlReader;
ProjectidList.DataTextField = "Project_ID";
ProjectidList.DatatValueField = "Project_ID";
ProjectidList.DataBind();
}
|
|
|
|
|
This cannot be real....Read the error, it tells you exactly what's wrong. You misspelled the property. There is an extra "t".
What you wrote
ProjectidList.DatatValueField = "Project_ID";
What you should have written:
ProjectidList.DataValueField = "Project_ID";
I will use Google before asking dumb questions
|
|
|
|
|
hi all,
I am using listview where i draw the items by setting the ownerdraw property true and drawing using the drawitem event.
this works fine. now when i mouseover an item in listview, i need to show a small popup with the details of the item.
i found itemmouseover event which works only when the ownerdraw property is false.(ie the items are not drawn manually).
how can i achieve this task?
Please help me with suggestions.
Thanks in advance.
Regards
Anuradha
|
|
|
|
|
hi all,
so stupid of me. sorry for troubling you people. i commited a silly mistake.
the event is not triggered at all because the code in the designer.cs got deleted.
did not notice that.
thanks for viewing and sorry for the wrong post.
Regards
Anuradha
|
|
|
|
|
i want to add progress bar on windows form and its functioning must start on button click
|
|
|
|
|
A progress bar changes it's value when you change the value in code. So you add at the button click event code to change the progress bar's value.
Hope it helps.
I will use Google before asking dumb questions
|
|
|
|
|
use PerformStep()
you can define one step value in property of progressbar
Becoming Programmer...
|
|
|
|
|
I am trying to do UPS Integration in ASP.NET 2.0 using c# in my project but
but i am not able to integrate it in my code.
I want to integrate ups and get the Shiping charges for Products.
Can anyone have an idea or documents to do this UPS Integration?
|
|
|
|
|
Here's a thought. Have you tried asking UPS?? After all, they're the ones supplying the library you have to use.
|
|
|
|
|
Not very helpful Dave. If you had any experience at the UPS API's--and apparently you do because you attempted to supply an answer to his question--you'd know their documentation and sample is crap.
-K
|
|
|
|
|
You've been around here for 8 years and this is the first thing you post?? To a 5 YEAR old post!?
My answer was dead on. I don't care how bad the documentation is, you still ask the people who wrote the library how to use it.
Would go walking into a car dealership asking about support questions for a BMW motorcycle?? Probably not... That's what this guy tried to do so many years ago.
|
|
|
|
|
I have just added a listview onto a windows form. I have added 1 column to the listview and 4 items. I then set the View property to details. In the form load event of the windows form, I set the selected item to index 2 (item3) like this:
listView1.Items[2].Selected = true;
When the form loads item3 is selected as its back colour is blue but the first item has a dotted line around it. When I press the down arrow on my keyboard I should expect item4 to be selected. But instead item2 is selected as though I have pressed the up arrow. This must mean that item1 is the selected item when the form loads. Can anyone help me to solve this problem please?
Lucy
|
|
|
|