I want to get the exact width and height of the loading page.
saguni commented: old methodology, but it will work i hope. +0
ss125 18 Posting Whiz in Training
ss125 18 Posting Whiz in Training
I want to get the exact width and height of the loading page.
I am trying to get the width and height of the uploaded html file. This is what i have done so far.
WebBrowser wb = new WebBrowser();
int ht,wd;
wb.Navigate("D:\\page1.HTM");
ht = wb.Height;
wd = wb.Width;
But the above code always return me the wrong size of the page.
Can anyone help me to get the exact page size in the c# environment?
Thanks in advance.
Just to add...
I am using this in a procedure. But I cant use paramemters to classify the code. I tried that.. but my senior says that as an lack of codereusability...
Hello friends,
I am using sql server 2005 as a backend.
I want to filter the datagrid based on fromdate,todate,companyname,employee name.
I have done the date filter's....
The problem is with the other two filters.
The actual problem is..
The application has to filter based on company only if the user provides input in the front end.
the same goes to the employee name...
I got stuck here.
Please help me out.
This is my code which i Have tried so far...
SELECT
TR.EMPLOYEECODE,
CASE WHEN TR.GENDER = 'M' THEN 'MALE' ELSE 'FEMALE' END AS GENDER,
TR.EMPLOYEENAME,
EMP.COMPANYNAME,
TR.PANNO,
CASE
WHEN TR.KYCSTATUS = 'Y'
THEN 'YES'
WHEN TR.KYCSTATUS = 'N'
THEN 'NO'
END AS [KYCSTATUS],
TR.COSTCODE,
TR.LOCATION,
TR.CORREMAIL,
TR.CORRMOBILE,
dbo.FNGETDATE(TR.ENROLMENTDATE) REGISTEREDDATE,
ONE.SCHEMENAME1,
ONE.[1] AS [SCHEME1 AMOUNT],
ISNULL(TWO.SCHEMENAME2, '') SCHEMENAME2,
ISNULL(CAST(TWO.[2] AS VARCHAR), '') AS [SCHEME2 AMOUNT],
ISNULL(THREE.SCHEMENAME3, '') SCHEMENAME3,
ISNULL(CAST(THREE.[3] AS VARCHAR), '') AS [SCHEME3 AMOUNT],
ISNULL(Four.SCHEMENAME4, '') SCHEMENAME4,
ISNULL(CAST(Four.[4] AS VARCHAR), '') AS [SCHEME4 AMOUNT],
SUM(SH.EMPLOYEEAMOUNT)AS [TOTAL MONTHLY EMPLOYEE CONTRIBUTION AMOUNT]
FROM TRN_ENROLMENT TR
JOIN VW_EMPLOYEE EMP
ON EMP.EMPLOYEESEQ=TR.EMPLOYEESEQ
JOIN TRN_ENROLMENTSCHEME SH
ON TR.ENROLMENTSEQ=SH.ENROLMENTSEQ
LEFT JOIN(select ENROLMENTSEQ, EMPLOYEESCHEMESEQ,SCHEMENAME1, [1] from
(select ENROLMENTSEQ, EMPLOYEESCHEMESEQ,sch.SCHEMENAME as SCHEMENAME1, EMPLOYEEAMOUNT,
DENSE_RANK() OVER (PARTITION BY employeeseq ORDER BY enschemeseq DESC) AS Ranks
from TRN_ENROLMENTSCHEME
join CMN_MST_SCHEME sch
on sch.SCHEMESEQ=EMPLOYEESCHEMESEQ
where
RECORDSTATUS <> 'D')src
pivot
(sum(employeeamount)
for ranks in ([1], [2], [3], [4])
)as pivottable
where [1] is not null)ONE
ON ONE.ENROLMENTSEQ = TR.ENROLMENTSEQ
LEFT JOIN(select ENROLMENTSEQ, EMPLOYEESCHEMESEQ,SCHEMENAME2 ,[2] from
(select ENROLMENTSEQ, EMPLOYEESCHEMESEQ,sch2.SCHEMENAME as SCHEMENAME2, EMPLOYEEAMOUNT,
DENSE_RANK() OVER (PARTITION BY employeeseq ORDER …
For an update,
You can use image datatype. Hope it will be precise for the operation...
And also post the relevant codes as Ketsuekiame said.
It will save a considerable amount of time.
First is the fastest among all...Because it uses one bitwise and one arithmatic operator..
Next comes the second. 2 bitwise and two arithmatic operator.
The code with highest time complexity is third. Once my teacher taught " It looks like simple, but When ever a multiplication code is called the compiler will perform inner addition operation. But due to its coding structure, most programmers use this kind of notations.".
Hope this helps you...
Have a happy coding...:D
@caperjack,
Thank you for your suggestion. Then i must wait some time to buy anew PC...
Thanks to Everyone who helped me...
@aVar++,
My friend, I wanna know whether the above mentioned graphics card can be used to play the above games. Because, when it comes to processor, I am a noob. I dont evn know which one came first. So can you help me out a bit?
Till now only old games like most wanted(old), gta vice city and some games at same properties.
But now i am planning to play NFS MW 2012, fifa 13, Run, like that.
Fine... That leaves me without option :-). I will try and intimate you guys shortly...
Thanks for your response.
I have a suggestion here...
Instead of doing like this, why cant to add a javascript that allows only numbers to be added in the control?
Because it saves the validation time and provides more simplicity...
And
http://www.gainward.com/main/vgapro.php?id=874
this too?
Because these two are suitable based on money. Now I need to know which is best suited for my PC. Can anyone helpme?
guys while searching internet, I found this card.
ZOTAC GT 610 2GB DDR3 Synergy Edition Graphic Card
Is it suitable for my configuration?
@caperjack,
The link you suggested.. Is it about the motherboard?
@aVar++
You are right.I am not in a position to buy a new PC. Its just just for entertainment purpose only. So I decided to upgrade the graphics memory and the RAM exclusively for gaming purpose.
I hope that answered something to you @JorgeM
@caperjack
This is the analysis result from the software you suggested..
**Operating System**
Windows XP Professional 32-bit SP2
**CPU**
Intel Pentium E2160 @ 1.80GHz 38 °C
Conroe 65nm Technology
**RAM**
1.00GB Single-Channel DDR2 @ 333MHz (5-5-5-15)
**Motherboard**
Gigabyte Technology Co., Ltd. 945GCM-S2L (Socket 775)
**Graphics**
LCD-MONITOR (1280x720@60Hz)
LCD-MONITOR (1280x720@60Hz)
Intel 82945G Express Chipset Family (Gigabyte)
**Hard Drives**
149GB Western Digital WDC WD1600AAJS-22PSA0 (SATA) 40 °C
**Optical Drives**
HL-DT-ST DVD-RAM GH22NP20
DTSOFT Virtual CdRom Device
**Audio**
Realtek High Definition Audio
@Ketsuekiame,
Fine. But I can use it as an last resource.
because i am new to console application.
I am having little doubts regarding basics of c#.
Before that, let me explain you a scenario.
My code will be like
void main()
{
DateTime a=DateTime.Now;
DateTime b=DateTime.Now.AddMinutes(1);
//
Codes that needs to be executed all the time.
//
int Difference = (b - a).Minutes;
if(timedifference=1)
{
//
call function i.e., code that has to be executed for every minute
//
}
}
The above is my coding procedure which i have planed so far.My doubt is that
1)whether the condition is checked frequently or only once?
2)if the entire code is executed again and again does the datetime values are initiated every time?
The questions may be childish... But I am noob when it comes for console app..
Hello friends,
I had done some questions regarding function call.
I had done an console application that can run a particular set of code every minute.
For that i used
System.Threading.Thread.Sleep(60000);
That worked well too.
But now i stuck in another problem.
Now I dont wanna use the above code.Because of the reason the thread.sleep() makes the entire application to sleep for a minute. But I am having a code that must be executed in the mean time.
Any suggestions or help?
TIA...
very simple my friend.
First add a dummy ID in the databse
for eg,
empid empname
1 admin
then before insert find the max(empid)
then add one to it.
and include it in every query you process.
This can be done in frontend.
I am not the one who can help in databse side.
But I am sure that autoincrement is there at mysql I hope.
May be the one who is good at database can help you on that....
Hope this helps you...
Have a happie coding...:=D
I know that too write2varun. I just want everything to be stored in database only. Hence i have to do it.
Even I was wondering about this... But when I googled i got an information like this...
Updating a data source is much easier using DataAdapters. It's easier to make changes since you just have to modify the DataSet and call Update.
This is probably no (or very little) difference in the performance between using DataAdapters and Commands. DataAdapters internally use Connection and Command objects and execute the Commands to perform the actions (such as Fill and Update) that you tell them to do, so it's pretty much the same as using only Command objects.
Hope this helps you..
Have a happy coding...:-D
Based on the design you said,eventhough if it is of 5 - 10 records there are no options than that of manual insertion.
But this is bulk. So either you have to use a sqlbulkcopy.
There is also another way, if your system supports reporting in excel sheet.
The ball is in your court...
You have to decide...
My friend,
you stated that you are selecting a record from grid. Which control are you using?
Is it a checkbox?
@themaj,
I need some information...
Does your table contains any unique id's?
If so, I am having a algorithm to do what you need...
My friends I was working on the concept like a user can upload his image as a user avatar, and that should be shown in all his pages.
I have two pages namely get.aspx and show.aspx
get.aspx contains image file uploading and saving the records in database.
show.aspx is to show the image file of the user.
I got the image in the form of byte[].
But I need to display it as a image.
Here is the code for show.aspx.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data.SqlClient;
using System.Data;
using System.IO;
using System.Drawing;
namespace ImagesaveinDB
{
public partial class show : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
ShowEmpImage(001);
}
public Stream ShowEmpImage(int empno)
{
string conn = "asdasdasdas";
SqlConnection connection = new SqlConnection(conn);
string sql = "SELECT empimg FROM EmpDetails WHERE empid = @ID";
SqlCommand cmd = new SqlCommand(sql, connection);
cmd.CommandType = CommandType.Text;
cmd.Parameters.AddWithValue("@ID", empno);
connection.Open();
object img = cmd.ExecuteScalar();
//show sh = new show();
//DataTable dt = cmd.ExecuteScalar();
//sh.Image1.ImageUrl = img;
try
{
Byte[] bytes = (Byte[])img;
MemoryStream stream = new MemoryStream((byte[])img);
Bitmap bitmap = new Bitmap(stream);
show s1 = new show();
//s1.Image1.
//Image1.ImageUrl(bitmap);
return null;
//return new MemoryStream((byte[])img);
}
catch(Exception e)
{
Response.Write(e);
return null;
}
finally
{
connection.Close();
}
}
}
}
I need your help in doing this friends.
Thank you in advance...
Are you displaying in a grig?
Then the best thing to do is that unistalling the current one and install other programs like avast, kaspersky of your wish...
PERSONALLY FROM MY EXPERIENCE I RECOMMEND AVAST....
@aVar++,
To be precise, I am very sure of upgradation as mentioned above..(due to some other factors).
So I am in need of advice regarding what are the thing i have to notice while purchasing it and whether it supports my system and also with the other upgradations that were going to be made...
When did you recently update the program?
Fine. then try this.
Place a checkbox in your form to get whether the user needs autocomplete.
then
use the following code to check whether the user needs autocomplete.
If CheckBox1.CheckState = 1 Then
//if user needs autocomplete
//Your code for autocomplete here...
else
//leave it blank
End If
Hope this helps you...
Have a happy coding...:-D
Hello friends,
I am having a HCL PC in my home with configuration of 120GB HDD, basic graphics memory, Core2Duo processor and with 1 gb of RAM.
Now I am planning to do some upgrades to it.
First of all, I am planning on DVD writer(already out).
Then to the Graphics memory of 1 GB.(I am a Gamerguy:-P).
Then to RAM of 2GB(for the support of game purpose).
Friends, I want some suggestions from you, regarding what brand I should go for and which is best.
Can the geeks in this forum help me?
Thanks in advance...:-D
Arrays can do this job quite well...
Instead of writing it in initialize event, write the code in the combo change event...
and to get the value from the particular cell in an excel sheet, you have to something which refers to the particular cell like
Dim oApp As New Excel.Application
Dim oWBa As Excel.Workbook = oApp.Workbooks.Open("c:\Test.XLS")
Dim oWS As Excel.Worksheet = DirectCast(oWBa.Worksheets(1),
Dim oRng As Excel.Range
oRng = oWS.Range("D6")
MsgBox(oRng.Value)
Hope this helps you...
Have a happy coding...:-D
are you using a button or a checkbox to select the autocomplete option in your form?
You mentioned earlier that you copied some codes from the default login program.
Well you probably copied some unnecessary codes. thats the main cause of the problem.
If you have any question, feel free to ask else kindly marked the problem as solved...
Anyway, Have a happy coding..:-D
Based on your question, I think you are a noob to asp.net.
Anyway,I wanna ask a questions.
1) According to your code, you are using text command(query). Then why should it provide a error like that(such as procedure not found exception)?
Soln:
try to create it on your own. no sweat. there are several tutorils available step by step code.
Sugestion:
TRY TO ANALYZE WHY THE ERROR CAME AND THINK BACK WHERE YOU HAVE DECLARED THE PROCEDURE(THE CAUSE FOR THE EEROR) IN YOUR PROGRAM....
Hope this helps you..
Have a happy coding...:-D
In Tamil there is statement,"Manusana ivan!!!"
I hope that suits you well @JorgeM...
It means, You are a beast in knowledge...
You should pick something that you're interesting in and excel at that before you go and tackle the worlds problem with regards to computing.
what @phorce said, is 100% right according to me.
Once you excel in one field, you will automatically know which one you want to excel next...
Likewise you should go on...
There is no end for learning at all...
What antivirus are you using?
or first did you installed antivirus program in your system?
Well said @Stuugie..
Just to add, you can also use a new table. The only rule to follow, while designing the structure of the table, is to assure that the problem which you are currently facing, will not occur on the future. If you are a well planner, you can go for new table. else stick with the first option.
Thanks...
yup sorry for that..
Semoi-colon missing
Sorry for that my friend...
Just to add with @deceptikon,
when an if statement is written in a function, then all the paths(i.e., if statements) must return a value, other than the common return value of the function.
Hope this helps you..
Have a happy coding...:-D
stringSQL4 = "INSERT INTO " & tdf2.Name & " SELECT " & tdf.Fields(z) & " FROM " & tdf.Name & "'"
replace the string by
stringSQL4 = "INSERT INTO " & tdf2.Name & " SELECT " & tdf.Fields(z) & " FROM " & tdf.Name & ""
stringSQL4 = "INSERT INTO " & tdf2.Name & " SELECT * FROM " & tdf.Name & "';"
there is error in you sql string
"';"
the ' will not come.
sort that out and execute...
Have a hapie coding...:-D
Nice Information... Since I am related to financial domain(eventhough our clients are not from the above mentioned location) we can atleast provide an alert regarding this information to ur clients..
stringSQL4 = "SELECT * INTO " & Text5.text & " FROM " & Text5.text & " IN '" & Text3.text & "';" ****
The select * into table1 from table2 where 1=1 creates table1 and inserts the values of table2 in them. So, if the table is already created that statement would give an error.
The insert into table1 select * from table2 only inserts the values of table2 in table1.
"And I also noted that you are copying from same table the select * into allows two different tables."
Thats the reason for the error Table already exists
Hope this helps you...
Have a happy coding...:-D
k can you try and tell using the following query.. Its for a test purpose.
ds = commm.GetDataSet("SELECT Stu_ID FROM StudentTable");
@AARTI SHRIVAS
What you said is a point to be considered, but there is a quote "Revealing the truth is better then hiding them".
If my memory serves right,
for the following code,
string sqlCommand = "SELECT * FROM TABLE";
string connectionString = "blahblah";
DataSet = GetDataSet(sqlCommand,connectionString);
GetDataSet()
{
//...?
}
you need to code something like the following
public DataSet GetDataSet(string ConnectionString, string SQL)
{
SqlConnection conn = new SqlConnection(ConnectionString);
SqlDataAdapter da = new SqlDataAdapter();
SqlCommand cmd = conn.CreateCommand();
cmd.CommandText = SQL;
da.SelectCommand = cmd;
DataSet ds = new DataSet();
conn.Open();
da.Fill(ds);
conn.Close();
return ds;
}
Hope this helps you...
Have a happy coding...:D