|
If you're prepared to pay then, this[^] is the one I use. It's high performance, and very scalable.
|
|
|
|
|
Hello,
I have searched for demo project for Stack Exchange Redis in .NetFramework 4.0 C# but I didn't find yet.
Please share if possible.
Need: I want to use this in caching for storing just key, value pair. I have used system.caching but it destroy cache after service restart.
So I have used first Service Stack Redis but it have limitation of 6000 request per day and my project have almost 282984 requests per day.
So I switched to Stack Exchange Redis. I have made sample project and it works fine in my local machine. But when I deploy project on staging environment gives below error:
It was not possible to connect to the redis server(s); to create a disconnected multiplexer, disable AbortOnConnectFail. UnableToResolvePhysicalConnection on PING
StackExchange.Redis.RedisConnectionException: It was not possible to connect to the redis server(s); to create a disconnected multiplexer, disable AbortOnConnectFail. UnableToResolvePhysicalConnection on PING
at StackExchange.Redis.ConnectionMultiplexer.ConnectImpl(Func`1 multiplexerFactory, TextWriter log)
at StackExchange.Redis.ConnectionMultiplexer.Connect(String configuration, TextWriter log)
at StackExchangeApplication.Source.Service.RedisService..ctor()
at StackExchangeApplication.Source.Service.RedisService.get_GetInstance()
at StackExchangeApplication.RedisHelper.GetStringValue(GetValueRequestMessage requestMessage)
Here is my code:
public class RedisService
{
public static ConnectionMultiplexer _connection;
public static IDatabase _redisDatabase;
static RedisService()
{
_connection = ConnectionMultiplexer.Connect("localhost");
_redisDatabase = _connection.GetDatabase();
}
public void AddStringKeyValue(string key, string value, int expireInMinute)
{
bool result = _redisDatabase.StringSet(key, value, TimeSpan.FromMinutes(expireInMinute), When.Always,
CommandFlags.None);
if (!result)
{
throw new Exception("Failed To add key value in Redis server Key : " + key + ", Value : " + value);
}
}
public string GetStringValue(string key)
{
string value = _redisDatabase.StringGet(key);
return value;
}
}
Please help if anyone tried this I am finding out solution from last 3 days .
Thanks in advance!
|
|
|
|
|
Just a wild guess (I have no idea what redis is) you are setting your ConnectionMultiplexer to localhost and deploying to a server which does not have localhost. You need to give the staging server the correct address to your redis server
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
I have same redis installed on each environment.
Connection sring was not actually the problem.
I resolved this issue using adding default port of Redis to firewall.
Thanks for answering!
|
|
|
|
|
hello
i want fill a text box or richtextbox or combobox with datagridview column content
this is my code
static public void refresh(DataGridView datagridview)
{
try
{
if (Connection.State == ConnectionState.Closed)
Connection.Open();
MySqlDataAdapter dataadapter = new MySqlDataAdapter("SELECT * FROM suTable", Connection);
DataTable dt = new DataTable();
dataadapter.Fill(dt);
datagridview.DataSource = dt;
}
catch (MySqlException Exception)
{
MessageBox.Show(Exception.ToString());
}
finally
{
Connection.Close();
}
|
|
|
|
|
Hang on a moment...
Yesterday you said:
yes i can get it and send to richtextbox When I asked you:
Well, you know how to get the contents of a DGV column, I assume? So you have forgotten overnight?
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
|
we work in group and my partner said i can do it now got problem withe getting dgv column content and send it to a text box
can u help me bro
|
|
|
|
|
So why not use the code that "your partner" was using yesterday? Why is it better to ask us?
And why the heck do you have multiple people using the same CP account?
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
|
this is the code but working
while(dt.rows.count>0)
{
txt1.text=dt.rows[0]["columnname"].tostring();
}
|
|
|
|
|
So, if it's working why are you asking us?
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
|
|
1) Don't shout.
2) Make your mind up:
Member 11579870 wrote: this is the code but working/blockquote>
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
|
Well apart from the fact you missed "not" out of the sentence, and apart from the fact that code won't compile (C# is case sensitive!), that is an infinite loop.
Other than that what do you mean by "not working"? Explain what happens or what exception is raised
|
|
|
|
|
Personally, I'd consider using something like this:
StringBuilder sb = new StringBuilder();
foreach (var row in dt.Rows)
{
sb.AppendFormat("{0};", row["columnname"]);
}
txt1.Text = sb.ToString();
|
|
|
|
|
thank you but not working
|
|
|
|
|
Error 2 Cannot apply indexing with [] to an expression of type 'object'
Error 3 The name 'textbox1' does not exist in the current context
my text box name is textbox1
|
|
|
|
|
Error 3 says that textbox1 isn't visible in that class.
Error 2 - well, the error will give you a line number. What's at that line? Double click on the error in the error window and Visual Studio will take you to that line (note, this is the error window, not the output window).
|
|
|
|
|
If you were expecting someone to write your code for you and do it perfectly, you're really don't have a clue how a forum like this works.
How is that going to happen when we can't see your code? (Don't bother posting it.) It's simply not possible.
It's YOUR JOB to take the code EXAMPLE Pete posted posted and adapt it to your code and situation. Go through the code and try to understand exactly what it's doing. If you don't know, lookup what each item in a statement does in the MSDN documentation.
If you don't understand the code, how on Earth are you going to expand on it and support it?
|
|
|
|
|
|
I am using C# with WPF. Database will be in server system. Client System will have only Sofware. I am new to Client and server. Server and client connected through LAN. Server windows 7 os
|
|
|
|
|
|
This is done by using a "provider" that is able to talk to the database (making connections, sending SQL queries and retrieving data, errors, ...).
There are several different providers for Oracle. probably the best is ODP.Net, but you also have OleDb or ODBC providers. I'd recommend wrapping the provider classes with a DAL (Data Access Layers) component.
Feel free to read this[^] article to get an idea.
To connect to the correct database you need a connectionstring. Look here[^] for more info.
Do a prototype first before directly changing your good application .
hope this helps.
|
|
|
|
|
hello
i'm using c# to create an application to send email to multiple email address that stored in datagridview column
this is the code for sending to single email
try
{
SmtpClient client=new SmtpClient("smtp.gmail.com",587);
MailMessage message = new MailMessage();
message.From = new MailAddress(txtemail.Text);
message.To.Add(txtreciever.Text);
message.Body = txtbody.Text;
message.Subject = txtsubject.Text;
client.UseDefaultCredentials = false;
client.EnableSsl = true;
if (txtattachment.Text != "")
{
message.Attachments.Add(new Attachment(txtattachment.Text));
}
client.Credentials = new System.Net.NetworkCredential(txtemail.Text, txtpassword.Text);
client.Send(message);
message = null;
MessageBox.Show("Message Sent");
}
catch(Exception ex)
{
MessageBox.Show( "Failed to Send Message");
}
|
|
|
|
|
And?
What's the problem you are having with multiple sends?
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
|
it sends only to one email >> message.To.Add(txtreciever.Text);
i have datagridview i need get emails from email column and send my email to all
|
|
|
|