 |
 |
Apologies for the shouting but this is important.
When answering a question please:
- Read the question carefully
- Understand that English isn't everyone's first language so be lenient of bad spelling and grammar
- If a question is poorly phrased then either ask for clarification, ignore it, or mark it down. Insults are not welcome
- If the question is inappropriate then click the 'vote to remove message' button
Insults, slap-downs and sarcasm aren't welcome. Let's work to help developers, not make them feel stupid.
cheers,
Chris Maunder
The Code Project Co-founder
Microsoft C++ MVP
|
|
|
|
 |
For those new to message boards please try to follow a few simple rules when posting your question.- Choose the correct forum for your message. Posting a VB.NET question in the C++ forum will end in tears.
- Be specific! Don't ask "can someone send me the code to create an application that does 'X'. Pinpoint exactly what it is you need help with.
- Keep the subject line brief, but descriptive. eg "File Serialization problem"
- Keep the question as brief as possible. If you have to include code, include the smallest snippet of code you can.
- Be careful when including code that you haven't made a typo. Typing mistakes can become the focal point instead of the actual question you asked.
- Do not remove or empty a message if others have replied. Keep the thread intact and available for others to search and read. If your problem was answered then edit your message and add "[Solved]" to the subject line of the original post, and cast an approval vote to the one or several answers that really helped you.
- If you are posting source code with your question, place it inside <pre></pre> tags. We advise you also check the "Encode "<" (and other HTML) characters when pasting" checkbox before pasting anything inside the PRE block, and make sure "Use HTML in this post" check box is checked.
- Be courteous and DON'T SHOUT. Everyone here helps because they enjoy helping others, not because it's their job.
- Please do not post links to your question into an unrelated forum such as the lounge. It will be deleted. Likewise, do not post the same question in more than one forum.
- Do not be abusive, offensive, inappropriate or harass anyone on the boards. Doing so will get you kicked off and banned. Play nice.
- If you have a school or university assignment, assume that your teacher or lecturer is also reading these forums.
- No advertising or soliciting.
- We reserve the right to move your posts to a more appropriate forum or to delete anything deemed inappropriate or illegal.
cheers,
Chris Maunder
The Code Project Co-founder
Microsoft C++ MVP
|
|
|
|
 |
I am working on a .Net application that needs to access the AS400 for some real-time and iDB2Connection is slow accessing DB2. any idea how can I improve it?
My connection string:
Dim connection As iDB2Connection = New iDB2Connection("DataSource=" & My.Settings.Server & ";" & _
"userID=" & My.Settings.ServiceID & ";" & _
"password=" & My.Settings.ServiceIDPass & ";" & _
"DefaultCollection=" & My.Settings.Library & ";" & _
"SSL=" & "False" & ";")
|
|
|
|
|
 |
What do you mean by "real-time" in this context?
Executing a query will take time, fetching and using the resulting data will also take time. How time-critical would this need be? Does it need to complete within 20ms? Less?
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
 |
Current execution time is 5 rec per sec. Which is not acceptable
|
|
|
|
 |
A "long" execution time for your query can have multiple causes. How big is each record? What speed is the network? I'm starting with these, as it seems to be the load-time that's your biggest bottleneck.
Can you show us how you load your data?
Have you tried comparing it to other compatible providers? (is ODBC available there?)
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
 |
And you showed us the connection string, not the query...
What does the query look like? Any JOINs WHERE clauses etc? Appropriate indices?
|
|
|
|
 |
If you are finding that actually establishing the connection, in the first instance, is slow, this is quite common with most databases. The way to get round this is to use a connection pool where inactive connections are stored ready for use again.
|
|
|
|
 |
Hi People
Hope anyone can help me.. I am trying to download some file.. and when i click on the Download All files.
It down loads a .NET file extension file.
so what programme i can use in order to open the .net file and download the main files
Thanks
|
|
|
|
 |
I would suggest either opening in NotePad to determine if you can tell what type of file it is or better yet, ask the person who posted it online.
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|
 |
I am new to WPF and the MVVM structure but I have create a simple? project which works fine.
DataModel
class MotionModel : INotifyPropertyChanged
{
public event PropertyChangedEventHandler PropertyChanged;
public event PropertyChangingEventHandler PropertyChanging;
private string m_TabletID;
public string TabletID
{
get { return m_TabletID; }
set
{
if (PropertyChanging != null)
PropertyChanging(this, new PropertyChangingEventArgs("TabletID"));
m_TabletID = value;
if (PropertyChanged != null)
PropertyChanged(this, new PropertyChangedEventArgs("TabletID"));
}
}
private string m_Instance;
public string Instance
{
get { return m_Instance; }
set
{
if (PropertyChanging != null)
PropertyChanging(this, new PropertyChangingEventArgs("Instance"));
m_Instance = value;
if (PropertyChanged != null)
PropertyChanged(this, new PropertyChangedEventArgs("Instance"));
}
}
private string m_Database;
public string Database
{
get { return m_Database; }
set
{
if (PropertyChanging != null)
PropertyChanging(this, new PropertyChangingEventArgs("Database"));
m_Database = value;
if (PropertyChanged != null)
PropertyChanged(this, new PropertyChangedEventArgs("Database"));
}
}
public class DelegateCommand : ICommand
{
Predicate<object> canExecute;
Action<object> execute;
public DelegateCommand(Predicate<object> _canexecute, Action<object> _execute)
: this()
{
canExecute = _canexecute;
execute = _execute;
}
public DelegateCommand()
{
}
public bool CanExecute(object parameter)
{
return canExecute == null ? true : canExecute(parameter);
}
public event EventHandler CanExecuteChanged;
public void Execute(object parameter)
{
execute(parameter);
}
}
ViewModel
class MotionViewModel : BaseModel
{
ObservableCollection<MotionModel> motiontablets;
ICommand _command;
public MotionViewModel()
{
Title = "Tablets";
TabletInfo = new ObservableCollection<MotionModel>();
TabletInfo.Add(new MotionModel { TabletID = "RHL005771", Instance = @"\SQLEXPRESS", Database = "ACQ_RH_EXP_TABLET"});
TabletInfo.Add(new MotionModel { TabletID = "RHL005772", Instance = @"\SQLEXPRESS", Database = "ACQ_RH_EXP_TABLET" });
TabletInfo.Add(new MotionModel { TabletID = "RHL005773", Instance = @"\SQLEXPRESS", Database = "ACQ_RH_EXP_TABLET" });
TabletInfo.Add(new MotionModel { TabletID = "RHL005774", Instance = @"\SQLEXPRESS", Database = "ACQ_RH_EXP_TABLET" });
TabletInfo.Add(new MotionModel { TabletID = "RHL005775", Instance = @"\SQLEXPRESS", Database = "ACQ_RH_EXP_TABLET" });
TabletInfo.Add(new MotionModel { TabletID = "RHL005776", Instance = @"\SQLEXPRESS", Database = "ACQ_RH_EXP_TABLET" });
}
public ObservableCollection<MotionModel> TabletInfo
{
get
{
return motiontablets;
}
set
{
motiontablets = value;
OnPropertyChanged("TabletInfo");
}
}
public string Title { get; set; }
public ICommand RemoveCommand
{
get
{
if (_command == null)
{
_command = new RHG_MVVM.Model.MotionModel.DelegateCommand(CanExecute, Execute);
}
return _command;
}
}
private void Execute(object parameter)
{
int index = TabletInfo.IndexOf(parameter as MotionModel);
if (index > -1 && index < TabletInfo.Count)
{
TabletInfo.RemoveAt(index);
}
}
private bool CanExecute(object parameter)
{
return true;
}
My XAML is
<Window x:Class="RHG_MVVM.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:View="clr-namespace:RHG_MVVM.View"
Title="MainWindow" Height="350" Width="525">
<Grid>
<View:Tablets/>
</Grid>
</Window>
My question is how do I get me TabletINfo to load and write back to a XML file as two way binding???
Thanks
|
|
|
|
 |
I keep getting this argumentexception "value does not fall within the expected range" when trying to set the cooperativeLevel for a keyboard. please what could I be doing wrong? Thanks in advance.
|
|
|
|
 |
Without seeing the relevant code it's impossible to tell you what you did wrong.
|
|
|
|
 |
It would help to see your code but the error should be pretty clear. You are setting something that is invalid.
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|
 |
Sounds like the initial value of a control with "minimum and maximum" values is being exceeded.
|
|
|
|
 |
Hello,
I was wondering, if there is any way to create out of office rules (Reply-With Templates, forwardings... http://office.microsoft.com/en-us/outlook-help/send-out-of-office-notices-automatically-with-an-exchange-account-HP001232830.aspx#BM2[^]) in Exchange 2010 using c#? (Preferably EWS)
I know that this can be done in Exchange 2003 using MAPI, but I was unable to find any Information for Exchange2010...
Any suggestions?
|
|
|
|
|
 |
Hi i have created one web application and in that i need to read the data from Mysql database and bind to gridview.
I have written Mysql query as follows
SELECT @row_number:=@row_number+1 AS row_number,Name FROM tablename, (SELECT @row_number:=0) AS r
After running in Mysql in database it will and work show the result.
But if take same query and execute through C# code below error is coming.
An exception of type 'MySql.Data.MySqlClient.MySqlException' occurred in MySql.Data.dll but was not handled in user code
Additional information: Fatal error encountered during command execution.
and i will get Break or continue pop up. If i give continue it will show Parameter '@row_number' must be defined.
even i defined like int @row_number = 0; but same error.
I need to achieve serial number as shown below
ex in database
slno name
10102 nama1
2123 name2
5203 name3
result
1 nama1
2 name2
3 name3
how to achieve this. If anybody knows please reply me.
Thanks in advance.
|
|
|
|
 |
ven753 wrote: If i give continue it will show Parameter '@row_number' must be defined. There's an @-sign in there (declaring a user-variable), so .NET will assume you're declaring a parameter. There's no parameter in the collection with those names, hence the exception.
Easiest way out is to create a stored procedure. Wrap your SQL in there, call the sproc from .NET.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
 |
while I am sending SMS it give me Error Like "The Operation has time out " and I trace that error is in this line - "objStream = sResponse.GetResponse.GetResponseStream()"
Following is my Code
Dim sURL As String
Dim objReader As StreamReader
Dim objStream As Stream
Dim sResponse As WebRequest
sURL = " MyAPI"
sResponse = WebRequest.Create(sURL)
objStream = sResponse.GetResponse.GetResponseStream()
Can Any one help what is wrong I don't understand because first time it not give me that error while I am sending second time it give me that error
Help Me Please...
Thank You
Haresh Prajapati
|
|
|
|
 |
What is that URL supposed to be because what you have in there is not a URL and that's probably why your getting the timeout.
|
|
|
|
 |
Perhaps the OP obfuscated it for posting -- since this is about an SMS.
If it were not valid the second time, it would not have been valid the first time either -- and OP stated -- it worked the first time -- but not the second time.
|
|
|
|
 |
I would advise you to examine very carefuly your use of the streams and the WebResponse -- also avoid trying to reuse them -- this is an inherently asynchronous process and trying to create an SMS bulk texting application is not what those classes are intended to do -- it is one thing to use them to mimic browser fetches, but quite another to use them statically for multiple texts.
At the very least, close them and get them each time -- the Response -- are you reading to the end and closing the response?
|
|
|
|
 |
does anyone know if it is possible to sample an area of my screen,
eg every 5 second into my memory for it to be processed?
|
|
|
|
 |