|
No the PBX is not trying to make a connect. Even I am new to this socket programming, this is what I got as basic info from my peers in my company who are already working on sockets and PBX.
Please point me to a link or provide me a sample for connecting to PBX as client and fetching data from it. I also tried to connect to PBX by writing a client app and considering PBX as server.Even then I was unable to connect.
|
|
|
|
|
Arjun Mourya wrote: I got as basic info from my peers in my company who are already working on sockets and PBX. Then you need to talk to them and find out what address and port you need to connect to, and what special protocol exchange you need to use.
And your code needs to be written as a client application, not a server. Sample code for this can easily be found via Google.
Veni, vidi, abiit domum
|
|
|
|
|
I know the port number,address and protocol. I was able to make connection to the PBX by writing client application. But I did not receive any data apart from "\r-'. Any idea on how to proceed further?
|
|
|
|
|
Arjun Mourya wrote: Any idea on how to proceed further Yes, get hold of the documentation for the PBX and find out what commands and responses it uses.
Veni, vidi, abiit domum
|
|
|
|
|
You've written a TCP/IP based server. Well, the PBX is not a client and it's not going to seek out your server and connect to it. Sorry, but the code you've written is all for nothing.
The PBX is the server and you have to write the client portion.
|
|
|
|
|
I tried to connect to PBX by writing a client app and considering PBX as server.But even then I was not able to make a connection with PBX.Please point me to a link or provide me a sample.Also do we need to provide valid credentials while making a connectio to PBX?????
|
|
|
|
|
First things first. Does the PBX even support this? Which kind of server does the PBX expose? How do you have to connect to it?? What port does is it listening on?? This is all covered in the documentation on your PBX system.
What works for one PBX may not work for another. You start with the documentation on your system, not some piece of "sample" code.
|
|
|
|
|
I was able to make a connection to PBX but did not receive any data.I only received "\r-" as "13 45" in a byte array. I also made some test calls from an extension so that I can pull some data from PBX. I guess that I need to supply credentials to PBX to fetch data. Any idea on how the username and password string should be framed to be send to PBX.
|
|
|
|
|
Why do you think anyone here would know anything about your PBX system? AGAIN, this is what the documentation on the system is for!
|
|
|
|
|
Hi,
I'm having a trouble with a query SQLite with C#. I have two different datetimepickers on my windows forms app and when I try to get some data between two dates, it shows some stuff that I don't need or nothing without any errors.. I tried all the ways but nothing changed. Could you please suggest some things me to do?..
Thanks & Best Regards
Fatih BURAL
|
|
|
|
|
What type is the database-column? Is it a datetime, or a text-type? How does your query look? Are you sure the datetime-values are parsed correctly?
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
Sounds like you have an issue with differences in cultures. In other words, the data that you are retrieving is stored as one date culture, and the UI is using a different date culture.
|
|
|
|
|
Be careful - the value retrieved from the DateTimePicker may contain a Time also - remove that before you enter the value into your query.
|
|
|
|
|
Hi friends!
Thanks for your messages. My query down below;
"SELECT COMPANY_NAME,PRODUCT_NAME,P_STATUS,IMPORT_DATE WHERE IMPORT_DATE BETWEEN '" + dateTimePicker1.Value.ToString() + "' AND '" + dateTimePicker2.Value.ToString() + "' "
Database column is a datetime so is datetimepicker value. There are no errors but it shows only one date. I checked data types many times but what is wrong with this query?
|
|
|
|
|
Pete already pointed out that there might be a preblem with different formats (e.g. due to different cultures). Avoid that problem by using a parameterized query.
And as I told you above, remove the Time component of the value. dateTimePicker1.Value.Date will help you (and no: do not add a ToString()!).
|
|
|
|
|
I have done everything you said but it didn't work. So is there any other way to solve that problem? My new query that didn't work down below;
"SELECT COMPANY_NAME,PRODUCT_NAME,P_STATUS,IMPORT_DATE WHERE IMPORT_DATE BETWEEN '" + dateTimePicker1.Value.Date + "' AND '" + dateTimePicker2.Value.Date + "' "
Thanks & Best Regards For Your Support..
|
|
|
|
|
That will still convert the date to a string-representation. Use a parameterized query;
MyCommand.CommandText = "SELECT COMPANY_NAME,PRODUCT_NAME,P_STATUS,IMPORT_DATE WHERE IMPORT_DATE BETWEEN @Param1 AND @Param2";
MyCommand.Parameters.AddWithValue("@Param1", dateTimePicker1.Value);
MyCommand.Parameters.AddWithValue("@Param2", dateTimePicker2.Value);
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
Hi,
I'm trying to create a automatic login for a website... the problem is that the website keep giving me this error "Incorrect Email/Password Combination"...
However when i login manually with the exact username and pass that i used in the code... it works!!!
this is strange coz the code seems to work correct! it inserts the username and password into the editboxes and clicks the button called "login"... but then it returns the error!
Here is the code that i usually use:
public void EditboxFill(string Elementid, string TEXT)
{
wb.Document.GetElementById(Elementid).SetAttribute("value", TEXT);
}
public void ElementClick(string Elementid)
{
wb.Document.GetElementById(Elementid).InvokeMember("click");
}
public void Login()
{
ElementClick("sbxJxRegEmail");
EditboxFill("sbxJxRegEmail", "EMAIL");
ElementClick("sbxJxRegPswd");
EditboxFill("sbxJxRegPswd", "PASSWORD");
ElementClick("LoginBtn");
}
i don't think there is any errors in the code... as its the same code that i have used in previous projects, so i guess the site is just being difficult.
its strange that it works manually but not with the code... Therefore i think that i might have something to do with how the user clicks on the Textboxes.
The Textboxs have a PLACEHOLDER that is removed once the user clicks the text in the textbox... Prehaps because the actual text isn't being being clicked but only REPLACED... the site is using my login details as the PLACEHOLDERs... and treats my request as if no text has been entered.
when i try to login manually with empty values... i still get the error : "Incorrect Email/Password Combination"
so... any suggestions on fixing this???
|
|
|
|
|
It could be anyghing from a missing mouse hover event to a focus event. Why don't you use a tool for your browser and debug the website's javascript code.
BTW, what website are you talking about here?
Cheers!
"I had the right to remain silent, but I didn't have the ability!"
Ron White, Comedian
|
|
|
|
|
the website is called swagbucks.com
USERNAME input:
<input id="sbxJxRegEmail" class="sbxJxRegEmailEmpty" type="text" tabindex="1" data-active-state="sbxJxRegEmailFocus" value="" data-placeholder="Email Address or Swag Name" placeholder="Email Address or Swag Name" name="emailAddress" autofocus="autofocus"></input>
PASSWORD input:
<input id="sbxJxRegEmail" class="sbxJxRegEmailEmpty" type="text" tabindex="1" data-active-state="sbxJxRegEmailFocus" value="" data-placeholder="Email Address or Swag Name" placeholder="Email Address or Swag Name" name="emailAddress" autofocus="autofocus"></input>
submit Button:
<input id="sbxJxRegEmail" class="sbxJxRegEmailEmpty" type="text" tabindex="1" data-active-state="sbxJxRegEmailFocus" value="" data-placeholder="Email Address or Swag Name" placeholder="Email Address or Swag Name" name="emailAddress" autofocus="autofocus"></input>
i use these IDs in my code, it enters the username and password correctly and clicks the button.
however i believe the textboxs are submitted as blanks because i dont actually CLICK to edit them!
so what im looking for is code that will CLICK THE actual TEXT inside the editbox ... perhaps a Setfocus ???
IF this is not possible... What would be an alternative to login? Can i do this with WebRequests?
|
|
|
|
|
|
|
0) No, it's not urgent for us.
1) You should have posted this question in ASP.NET forum[^]
2) What have you tried?
3) Did you search Google?
4) Here a simple idea for solution.
Consider you have a table like below, add another column DisplayOrder
----------------------------------
CountryID CountryName DisplayOrder
----------------------------------
1 US 3
2 UK 2
3 India 1
----------------------------------
Now, write a query with sorting order - DisplayOrder column
SELECT CountryID, CountryName, DisplayOrder FROM TblCountry ORDER BY DisplayOrder ASC;
Now bind the query to DropDownlist .
5) From next time, follow this[^]
|
|
|
|
|
Hi,
I've been trying to get data from sql database within selected dates defined by datetimepicker. I've followed all necessary connection setup and query but there is this error SqlCeException at da.Fill(ds1, "upnp_daily"). It says a parameter is missing. I have tried all means but I couldn't spot where exactly goes wrong.
The following is my code. I really do appreciate it if someone could help me. Thanks in advance!
//-----Code-----
System.Data.SqlServerCe.SqlCeConnection con;
System.Data.SqlServerCe.SqlCeDataAdapter da;
DataSet ds1;
private void connectSQLserver()
{
//Connecting to SQL Server Express Database
string strDataSource = @"Data Source=C:\Visual Studio 2010\Projects\UPNP_Form_F\UPNP_Form_F\bin\Debug\upnp_database.sdf";
con = new System.Data.SqlServerCe.SqlCeConnection();
con.ConnectionString = strDataSource;
con.Open();
ds1 = new DataSet();
SqlCeCommand cmd = new SqlCeCommand();
cmd.CommandText = "SELECT * FROM upnp_daily_energy WHERE Date >= @p_StartDate AND Date <= @p_EndDate";
cmd.Parameters.Add("@p_StartDate", SqlDbType.DateTime).Value = dtpSTART; //get date from date time picker
cmd.Parameters.Add("@p_EndDate", SqlDbType.DateTime).Value = dtpEND;
cmd.Connection = con;
da = new System.Data.SqlServerCe.SqlCeDataAdapter(cmd.CommandText, cmd.Connection);
try //run the query
{
da.Fill(ds1, "upnp_daily"); //run the query
}
catch (Exception e2)
{
MessageBox.Show("Error 7: " + e2.ToString()); //<<--- Error here!
}
MessageBox.Show("Connection Open"); //<<---DEBUG
MaxRows = ds1.Tables["upnp_daily"].Rows.Count; //get no of rows in DataSet
MessageBox.Show("No of rows in DataSet = " + MaxRows.ToString());
}//------------------------------------------------------------------------------------
modified 28-Nov-13 2:33am.
|
|
|
|
|
I'm not that surprised:
cmd.Parameters.Add("@p_StartDate", SqlDbType.DateTime).Value = dtpSTART; No, it doesn't.
It tries to pass a DateTimePicker control into the parameter as a DateTime value!
Try this:
cmd.Parameters.Add("@p_StartDate", SqlDbType.DateTime).Value = dtpSTART.Value;
cmd.Parameters.Add("@p_EndDate", SqlDbType.DateTime).Value = dtpEND.Value; Or better:
cmd.Parameters.AddWithValue("@p_StartDate", dtpSTART.Value);
cmd.Parameters.AddWithValue("@p_EndDate", dtpEND.Value);
|
|
|
|