|
Thanks for answering!
Yes, I am sure that is not the case. The textbox is just there so I have something else to give focus to. The only reason this is databound, is for testing purpose. (That databinding actually works as it should.) My original case was without the textbox.
It seems that the problem occures when the databinding object tries to set
CurrentPerson = (IPerson)comboBox1.selectedItem;
(or whatever syntax the databinding use.) If I implement this line of code when selected item is changed, it all works just fine.
Any other ideas? I am really stuck here
|
|
|
|
|
Problem solved! (At least workaround found...)
If you are interested in the solution, take a look at http://www.devexpress.com/Support/Center/p/Q182427.aspx
|
|
|
|
|
Hi
i use this code to iterate through each procedure in current database :
foreach (Microsoft.SqlServer.Management.Smo.StoredProcedure sp in server.Databases[database].StoredProcedures)
{
if(!sp.IsSystemObject)
sps.Add(sp.Name);
}
but when i add if(!sp.IsSystemObject) statement, my app hangs and crash. why this problem occurs and how to solve it?
thanks
|
|
|
|
|
Try with else instead of !
if(sp.IsSystemObject) // this line
{
}
else
{
sps.Add(sp.Name);
}
pls let me know the result
Thanks
Raja.S
|
|
|
|
|
Thanks Raja
i test your code, but my app has still crash.
|
|
|
|
|
is that showing the exception or just closing the application if possible can you give me the stack trace ?
Thanks
Raja.S
|
|
|
|
|
not any exception, just crash, here is my source code to explore what is my method:
private void GetDatabaseSps(TreeView tree, TreeNode spsNode, string sqlServerInctance)
{
List<string> sps = new List<string>();
string database = spsNode.Parent.Text;
Microsoft.SqlServer.Management.Smo.Server server = new Microsoft.SqlServer.Management.Smo.Server(sqlServerInctance);
foreach (Microsoft.SqlServer.Management.Smo.StoredProcedure sp in server.Databases[database].StoredProcedures)
{
if (sp.IsSystemObject)
{
}
else
{
sps.Add(sp.Name);
}
}
spsNode.Nodes.Clear();
foreach (string str in sps)
{
TreeNode spNode = new TreeNode(str);
spsNode.Nodes.Add(spNode);
}
}
|
|
|
|
|
Can you tell me ,is this happening with SQL 2005 with SP2 and also visual studio 2003 or 2005 ?
Thanks
Raja.S
|
|
|
|
|
hai all ,
we used below method for get the image data from database,it is working fine in desktop computers ,but it is not working in laptops.it is showing below error only in laptops.
Error Message:
out of memory:at System.image.fromfile(string filename,boolean useembeddedcolormanagement) at System.Drawing.image.fromfile(String Filename)
Please help me.
public void getimages()
{
bigImgLst_Vendors.Images.Clear();
smallImgLst_Vendors.Images.Clear();
string path;
path = Path.GetDirectoryName(
Assembly.GetExecutingAssembly().GetName().CodeBase);
path = path.Replace("\\bin\\Debug", @"\Transaction\Contacts\Photos");
path = path.Replace("file:\\", "");
string imageDirectoryPath = path;
string[] files = null;
if (Directory.Exists(imageDirectoryPath))
files = Directory.GetFiles(imageDirectoryPath);
if (files != null)
if (files.Length > 0)
for (int i = 0; i <= files.Length - 2; i++)
if (File.Exists(files[i]))
{
//foreach (ListViewItem vcontext in lvw_VendorList.Items)
//{
//if(vcontext.Tag == (files[i].Split('\\'))[files[i].Split('\\').Length - 1])
bigImgLst_Vendors.Images.Add((files[i].Split('\\'))[files[i].Split('\\').Length - 1],
Image.FromFile(files[i]));
smallImgLst_Vendors.Images.Add(
(files[i].Split('\\'))[files[i].Split('\\').Length - 1], Image.FromFile(files[i]));
//}
}
int imageIndex = -1;
int NoImageIndex = 0;
NoImageIndex = bigImgLst_Vendors.Images.IndexOfKey("NoImage.png");
lvw_VendorList.LargeImageList = bigImgLst_Vendors;
lvw_VendorList.SmallImageList = smallImgLst_Vendors;
lvw_VendorList.StateImageList = smallImgLst_Vendors;
foreach (ListViewItem vcontext in lvw_VendorList.Items)
{
if (vcontext.Tag != null)
if (vcontext.Tag.ToString().Trim() != "")
imageIndex = bigImgLst_Vendors.Images.IndexOfKey(vcontext.Tag.ToString());
if (imageIndex != -1)
vcontext.ImageIndex = imageIndex;
else
vcontext.ImageIndex = NoImageIndex;
imageIndex = -1;
}
}
|
|
|
|
|
It has nothing to do with Laptop or Desktop.
I also had to write code that generating thumbnails some time ago. .NET throws OutOfMemoryException if it does not recognize the image format.
This happen for example when loading the image file whose format is unreconized/unsupported by .NET. Methods might raise this exception
include Image.FromFile, Bitmap constructor, etc, see their "remark" section. You should debug your app to see if it is the cause.
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
Correction to my previous post.
I have created a windows application.
There are forms inside the windows form application project. There is a class library project too.
The .sln is in the following path:
C:\Work\Developments\SQLchecks\SQLchecks
The windows forms are inside the windows application project as below:
C:\Work\Developments\SQLchecks\SQLchecks\SQLchecks
There is a class library project called DataAccess which has classes and an xml file called Settings.xml :
C:\Work\Developments\SQLchecks\SQLchecks\DataAccess
Question:
from within a class inside the DataAccess project which is a class library project, how do I refer to the Settings.xml file which is also in the same directory?
Thanks
|
|
|
|
|
This is just plain rude to the other posters, and you can always modify your original post.
|
|
|
|
|
|
I agree. There is nothing more annoying that the one message board for our local mountain communities that some knitwits post something like *Bump* just to keep the thread alive. Some of the threads died for a reason
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
"Not only do you continue to babble nonsense, you can't even correctly remember the nonsense you babbled just minutes ago." - Rob Graham
|
|
|
|
|
hello,
i just want to know how can i create a Progressbar that represent the progress of a specific Form.
i mean, i have a Form with a lot of steps..that caculate a lot of things.
while wating that this progress will finish, i want to see the progress in the progressBar..
How can i do it?
thank you
|
|
|
|
|
Add the progress bar component to the form that you want to show it on. Set the maximum value to the number of steps you need to perform, and increment the value by 1 after each step completes.
|
|
|
|
|
DO you have any link that shows to me how to do it?
thank you
|
|
|
|
|
Admin887 wrote: DO you have any link that shows to me how to do it?
Really. Do I need to put a link on here for you? Why don't you try it out for yourself, as this is the best way to learn?
|
|
|
|
|
Thank you..it was very helpful..
|
|
|
|
|
|
Put a ProgressBar on the form and modify the Value property according to the progress that it is being made. You'll have to calculate that as a percentage yourself. (assuming that you show it like x %)
|
|
|
|
|
FYI you can set the maximum value so you don't need to calculate percentages.
If you have 5 steps, set the Maximum to 5 and increment the value by 1.
|
|
|
|
|
You can calculate a percentage for textual output in addition to a progress bar (I think that's what blackjack meant) by dividing two doubles... of course you should know how to compute a percentage.
Then you can use string functions to round that to a certain number of decimal points, but alas, I don't know the exact syntax.
“Time and space can be a bitch.”
–Gushie, Quantum Leap
{o,o}.oO( Looking for a great RSS reader? Try FeedBeast! )
|)””’) Built with home-grown CodeProject components!
-”-”-
|
|
|
|
|
thanks for your reply, but I fail to see that it could be useful for me
|
|
|
|
|
Well often a textual percentage is displayed on the progress dialog as well, or in its title bar so it can be seen on the task bar.
“Time and space can be a bitch.”
–Gushie, Quantum Leap
{o,o}.oO( Looking for a great RSS reader? Try FeedBeast! )
|)””’) Built with home-grown CodeProject components!
-”-”-
|
|
|
|