Quantcast
Channel: CSharp Forum Latest Questions
Viewing all 32756 articles
Browse latest View live

Opening Window form using timer?

$
0
0
Process:
I am having a table 
s.no ID_1 ID_2 content 
1 1001 4001 Hi
2 1002 4002 Hello
 
I used timer to bind this table in gridview of windows form
using the same timer i checked whether there is any content for the _ID2 from the table.
If the content value is true a new window form should be displayed.
 
Issue facing:
Each and every time the timer gets load it displaying the new windows even it is opened for the same _ID already how to check the form is open for the _ID which is opened already?
 

My code:
private void timer1_Tick(object sender, EventArgs e)
{
try
{
string Msg = string.Empty;
int Suc;
string tmpSuc = string.Empty;
string i;
string Role = Form1.role.ToString().Trim();
XmlNode Node;
int tmpSid;
string tmpChat = string.Empty;
wsTestService.STUDENTS_ONLINE(Role, out Node, out Msg, out Suc);
DataTable dt = new DataTable();
dt.Columns.Add("Students_Name", typeof(string));
dt.Columns.Add("ID", typeof(int));
dt.Columns.Add("Status", typeof(string));
foreach (XmlNode node in Node)
{
DataRow dr = dt.NewRow();
dr["Students_Name"] = node["Name"].InnerText;
Student_Name = Convert.ToString(dr["Students_Name"]);
dr["ID"] = node["ID"].InnerText;
tmpSid = Convert.ToInt32(dr["ID"]);
string chtdtm = "MM-d-yyyy";
string date;
wsTestService.CHAT_RECEIVE_MESSAGE(tmpSid, Tutor_ID, out tmpChat, out date, out tmpSuc);
DateTime today = DateTime.Today;
//chtdtm = Convert.ToDateTime(chtdtm);
string tmpdate;
tmpdate = today.ToString(chtdtm);
if (tmpChat != string.Empty)
{
if (tmpdate == date)
{
do
{
Chat_Box_Test objCTB = new Chat_Box_Test();
Chatting = tmpChat;
objCTB.Show();
} while (Student_ID == tmpSid);
}
}

 
//Chatting = tmpChat;
Student_ID = tmpSid;
i = node["Status"].InnerText;
if (i == "true")
{
dr["Status"] = "online";
}
else
{
dr["Status"] = "offline";
}
dt.Rows.Add(dr);
}
dataGridView1.DataSource = dt;
}
catch (Exception)
{
 
throw;
}

}

create recordset from jdbc datasource

$
0
0
I'm accessing data in jsp page using the following code.

<sql:query var="result" dataSource="jdbc/ums">
                    SELECT *  FROM ums_memory
</sql:query>

Now, I want to access the records using a recordset object like in ASP, so as its more flexible to process the records.

Is it possible to create a recordset object from datasource "jdbc/ums" ?


Adding Grredview in MVC 2asp.net

$
0
0
How to Simple Way to Adding Grredview in MVC 2asp.net

If delete files from server shared folder where it does go?

$
0
0
If we delete some files (doc,jpeg..so on ) from server by accessing local system where does the deleted files going ?
I didnt find that files neither server recycle bin nor local system recyclebin ?

When I delete files from shared folder they are not first placed in recycle bin
 Some how these files are deleting perminently
How can we restore ? or where does that file can find

How to retrieve same column twice with different conditions

$
0
0

I have 3 tables which are following::

Village

Village_ID     Village_Name

446261           ???????
446262            ??????
446263           ??????????
446264            ????
446265             ?????

Anganbadi_Master

Anganbadi_ID     Anganbadi_Name     Village_ID
  1307            ???????             446260
  1308            ??????-2           446260
  1309            ??????-1            446262
  1310            ??????-2            446262
  1311            ??????-3            446262
  1312            ??????????-1         446263
  1313            ??????????-2         446263

Anganbadi

Anganbadi_ID   Food    Month      Year
    1179        ???        5        2013
    1309        ???        1        2013
    1309        ????       1        2014
    1309        ???        2        2013
    1310        ???        1        2013
    1310        ???        2        2013
    1310        ???        3        2013
    1311        ????       3        2013
    2032        ???        3        2013

Now I want to retreive food column twice in the basis of two different years, where the same month of different years must appear only once, like following::

Anganbadi_ID    Month   food(2013)  food(2014)
1309             1          ???       ????
1309             2          ???       NULL
1310             1          ???       NULL
1310             2          ???       NULL
1310             3          ???       NULL
1311             3          ????      NULL

But, when I'm trying this code

SELECT DISTINCT Anganbadi.Anganbadi_ID
      , Anganbadi.Month
      , Anganbadi.Food  AS food2013
      , NULL            AS Food2014
  FROM Anganbadi
       INNER JOIN Anganbadi_Master ON  Anganbadi.Anganbadi_ID = Anganbadi_Master.Anganbadi_ID
       INNER JOIN Village ON  Anganbadi_Master.Village_ID = Village.Village_ID
 WHERE  (Anganbadi.Year = 2013)
   AND (Anganbadi_Master.Village_ID = 446262)
UNION ALL
SELECT Anganbadi_1.Anganbadi_ID
      , Anganbadi_1.Month
      , NULL                        AS food2013
      , Anganbadi_1.Food            AS Food2014
  FROM Anganbadi                    AS Anganbadi_1
       INNER JOIN Anganbadi_Master  AS Anganbadi_Master_1 ON  Anganbadi_1.Anganbadi_ID = 
            Anganbadi_Master_1.Anganbadi_ID
       INNER JOIN Village           AS Village_1 ON  Anganbadi_Master_1.Village_ID = 
            Village_1.Village_ID
 WHERE  (Anganbadi_1.Year = 2014)
   AND (Anganbadi_Master_1.Village_ID = 446262)


It shows following results::

Anganbadi_ID    Month   food(2013)  food(2014)
1309             1          ???       NULL
1309             2          ???       NULL
1310             1          ???       NULL
1310             2          ???       NULL
1310             3          ???       NULL
1311             3          ????      NULL
1309             1          NULL      ????

here Anganbadi_ID 1309 showing two different rows for same month (1 ) for year (2013 and 2014)

Syntax for show string value in File Upload control

$
0
0
Dear All,


Syntax for show string value in File Upload control in asp.net ?




Regards
Jagatpal Singh

can not view images in crytsal report

$
0
0
hi

I have a problem  in  showing  images form a Database I'm saving the image path in my DB table  but when i Follow this  link :

http://www.hexcentral.com/articles/crystal-images.htm in

it shows  only the path in the report  i don't know how to show my images in the crystal report.

smalltalk

$
0
0
where can i download the SMALLTALK installer(for writting the code)?

xaml code for themes

$
0
0
Dear Experts,

i wish to xaml themes code for dynamic changes in textbox listbox comb1box, form, grid, datagrid etc.

Trash is not working properly

$
0
0


 Hi,


 Trash is not working properly for me...Can anyone please tell me?

here is my code...


<script type="text/javascript">

      $(document).ready(function() {

          //Counter

          counter = 0;

          //Make element draggable

          $(".drag").draggable({

              helper: 'clone',

              containment: 'frame',



              //When first dragged

              stop: function(ev, ui) {

                  var pos = $(ui.helper).offset();

                  objName = "#clonediv" + counter

                  $(objName).css({ "left": pos.left, "top": pos.top });

                  $(objName).removeClass("drag");





                  //When an existiung object is dragged

                  $(objName).draggable({

                      containment: 'parent',

                      stop: function(ev, ui) {

                          var pos = $(ui.helper).offset();

                          //console.log($(this).attr("id"));

                          //console.log(pos.left)

                          //console.log(pos.top)

                      }

                  });

              }

          });

          //Make element droppable

          $("#frame").droppable({

              drop: function(ev, ui) {

                  if (ui.helper.attr('id').search(/drag[0-9]/) != -1) {

                      counter++;

                      var element = $(ui.draggable).clone();

                      element.addClass("tempclass");

                      $(this).append(element);

                      $(".tempclass").attr("id", "clonediv" + counter);

                      $("#clonediv" + counter).removeClass("tempclass");



                      //Get the dynamically item id

                      draggedNumber = ui.helper.attr('id').search(/drag([0-9])/)

                      itemDragged = "dragged" + RegExp.$1

                      //console.log(itemDragged)



                      $("#clonediv" + counter).addClass(itemDragged);



                  }
                  $("#trash").droppable({
                      drop:function(ev, ui) {
                                          accept: "#frame",
                   $(ui.draggable).remove();
                   




                      }
                  });

              }

          });

      });


  




  </script>


After dragging the letters into particular cell from that into trash it's working fine,problem is the letters are in the left side of the puzzle also droppable into trash permanantly.I want only drop the letters from cells into trash.

Thanks,
Saritha

Why did Estimated Subtree Cost increase with nonclustered

$
0
0

I have following table with six rows

CREATETABLE TimePeriod
(
        TimePeriodId intnotnullidentity(1,1)primarykey,
        TimePeriodName nvarchar(30)notnull,
        OrderId intnotnull,
        sDelete bitnotnulldefault'False'
)
When I run this query
        SELECT*FROM TimePeriod where timeperiodname='quarter'

Then Estimated subtree cost comes 0.0032886

But when defined non clustered index on  column TimePeriodName

CREATEUNIQUENONCLUSTEREDINDEX IX_TimePeriod_TimePeriodName
ON TimePeriod
(
        TimePeriodName ASC
)
 WITH (PAD_INDEX  =OFF,
  STATISTICS_NORECOMPUTE  =OFF,
  SORT_IN_TEMPDB=OFF,
  IGNORE_DUP_KEY=OFF,
  DROP_EXISTING=OFF,
  ONLINE=OFF,
  ALLOW_ROW_LOCKS  =ON,
  ALLOW_PAGE_LOCKS  =ON)

Then run query
        SELECT*FROM TimePeriod where timeperiodname='quarter'

I get Estimated subtree cost is  0.0065704

So why is cost incresing when non clustered index is defined on the table?
Where I am doing mistake?


use of Multiple web.config file in application.

$
0
0
What is the use of Multiple web.config file in  application.?

display word document online like image ?

Error Message, Data retrieval failed for the subreport- SSRS

$
0
0
Hi,
      I am developing RDLC report say A.rdlc with 2 subreports B.rdlc and C.rdlc. Each report getting data from different Data sources, but when there are no rows/data found for the 2 subreports, report is generating but I am getting error message as Data retrieval failed for the subreport, 'Subreport1', located at:Location\SubTrade.rdlc. Please check the log files for more information. I need to compress the subreports when data not found or need to show empty space instead of Error message. My piece of code is shown below...


        public void ProcessMainReport()
        {
            LocalReport reportContractNote = new LocalReport();
            reportContractNote.SubreportProcessing += new SubreportProcessingEventHandler(prcProcessSubReport);
            reportContractNote.ReportPath = ReportPath;
            int DataType = 0;// 0--For displaying Address details in Parent Report, 1--Trade Details in subreport 1, 2--Cash Details in Subreport2.
            ReportParameter recipientIDConsoCN = new ReportParameter(strparamRecipientIDConsoCN, RecipientID);
            ReportParameter batchdateConsoCN = new ReportParameter(strparamBatchDateConsoCN, BatchDate.ToString());
            ReportParameter transmittalreportIDConsoCN = new ReportParameter(strparamTransmittalReportIDConsoCN, TransmittalReportID.ToString());
            ReportParameter datatypeConsoCN = new ReportParameter(strparamDataTypeConsoCN, DataType.ToString());
            reportContractNote.SetParameters(new ReportParameter[] { recipientIDConsoCN, batchdateConsoCN, transmittalreportIDConsoCN, datatypeConsoCN });
            DataTable dtConsolidatedContractNote = new DataTable();
            dtConsolidatedContractNote = objBll.GetConsolidatedContractNoteData(RecipientID, BatchDate, TransmittalReportID, DataType);
            reportContractNote.DataSources.Add(new ReportDataSource("DataSet1", dtConsolidatedContractNote));
        }

        private void prcProcessSubReport(object sender, SubreportProcessingEventArgs e)
        {
            DataTable dtSubReport = new DataTable();
           
            try
            {
                switch (e.ReportPath)
                {

                    case strSubTrade://Name of the Sub-report Trade Details
                        //Code to fill Data in DataTable and bind it to SubReport SubTrade(Trade Details)
                        dtSubReport = objBll.GetTradeDetails(RecipientIDTradeDetails, BatchDateTradeDetails, TransmittalReportIDTradeDetails, 1);
                         ReportDataSource rdsTradeDetails = new ReportDataSource("DataSet1", dtSubReport);
                        e.DataSources.Add(rdsTradeDetails);
                        //Code End
                        break;
                    case strSubRecDisb://Name of the Sub-Report Cash Details
                        //Code to fill Data in DataTable and bind it to SubReport SubRecDisb(Cash Details)
                        dtSubReport = objBll.GetCashDetails(RecipientIDCashDetails, BatchDateCashDetails, TransmittalReportIDCashDetails, 2);
                        ReportDataSource rdsCashDetails = new ReportDataSource("DataSet1", dtSubReport);
                        e.DataSources.Add(rdsCashDetails);
                        //Code End
                        break;

                    default:
                        break;

                }

            }
            
        }

How to add new column b/w two existing columns in sql ?

$
0
0
How to add new column b/w two existing columns in sql ?

A good topic for lerarning crystal report very complete

$
0
0
Hithere firends and tnx every body that reaqd my quest?
 todays i want to be an expert in Crystal report by c# programming..i see some examples but they didnot complete for me..
is there a good source for know every thing about reporting???by many example??
tnx much

C# get user input(offset) & (write new value to offset)

$
0
0
Hello

After trying for hours and googling around i give up, also used the search here and couldn't find anything that i'm looking for.

I'm trying to make a windows form application where the "user" can enter a offset & new value to be written to the offset.

I've been trying to do it with Console.ReadLine(is there a better way?) and 2 textbox but it kept writing 0x00000000

Example1:

Textbox1>Offset: 0x00001234
Textbox2>Value: 9A05FF80
http://i.imgur.com/733ySBV.jpg

also how about this? instead of offset+value it would be find&replace.

Example2:

Textbox1>Find: whatever the user inputs (example: 6316707C6301947C6307B4E80100C07C)
Textbox2>Replace: whatever the user inputs as new(example: 1F011F3751F5FBA34719F514236FB1B3)

Best Regards

Need dumps for this topic 70-483 and 70-484

$
0
0
need dumps for 70-483 Programming in C# and 70-484 Essentials of developing windows store apps using c#

thanks in advance.......

Unit Testing using Nunit

$
0
0
Suppose I have a method:

Public int Sum(int a,int b)
{
return a+b;
}

I want to know what is the test case coding n how it is done using Nunit and upon which part of the logic, Unit Testing is done ?

does anyone herehave an idea in connecting android to a POS?

$
0
0
Good day everyone, I am just asking if anyone who could read this has an idea to connect an Android to a POS?? thnks for the reply :)

Viewing all 32756 articles
Browse latest View live