rohit manhas

rohit manhas

  • NA
  • 25
  • 0

java code to c#...

Mar 28 2010 7:23 AM
i want the given java code in c#...cud anyone help me with this.....

ResultSet resultset, resultset1;
            String localityid,villageid;
            try{
            Connection connection= DriverManager.getConnection("jdbc:odbc:rmcwhDSN");
            Statement statement= connection.createStatement();
            String familyid = request.getParameter("familyid");
            String tempSQL = "select * from HOUSEHOLDMEMBERS where FamilyId='"+familyid+"'";
            //out.println(tempSQL);
            resultset=statement.executeQuery(tempSQL);
            String tempMemberid="";
            String tempNum="";
            while(resultset.next())
            {
            tempMemberid = resultset.getString("MemberId");
            }
            //out.println(tempMemberid);
            int count1 = tempMemberid.length();
           // out.println(count1);
            
            //if(countl >2 ) {
                String memnum = tempMemberid.substring(count1-2);
                int memno = (new Integer(memnum)).intValue();
                //out.println ("Last member sq. number " + memno);                           
                memno++;
                String seqNo = Integer.toString(memno);
               // out.println ("Last member sq. number " + seqNo);                           
                if(memno < 10) {
                    tempMemberid = familyid.concat("0").concat(seqNo);
                }else{
                    tempMemberid = familyid.concat(seqNo);
                }
           // }    
            //tempMemberid = familyid.concat(count2);

Answers (1)