|
Hi stancrm!
thank you for reply to me.
I'll try using it.
is there an article that show how to use PdfSharp?
thank you...
|
|
|
|
|
or you can use PDF rasterizer too... also this one is open source i believe
|
|
|
|
|
thanks stancrm
your reply was great and helpful...(^^)
|
|
|
|
|
I've created a web browser class in my project(C#) and pass a url with few parametes to it.. this whole data gets visible on clicking on View Source on context menu.
How can i disable it?
|
|
|
|
|
|
Ok,
but can I do something to hide those data?
|
|
|
|
|
I dont think so. You cannot hide the HTML code. It stored in your local IE cache. You can also open it using Notepad. Or you can use SaveAs, it will also be saved as HTML file.
|
|
|
|
|
Dear All,
I am working on window application in C# i need to retrieve on record by using sql query but as record can't accessible with single query so i am using nested query to access the record query is correct i tested it in sql query analyzer but error in c# syntax query is this.....
rec = "select student_id from student_biodata where student_name = " + lstStudentName.Text + "";
string str = "select * from student_biodata where student_id = " + rec + "";
when i run this block error is Incorrect syntax near the keyword 'select'
this is in second query when i combining second query.
Please tell me what is the correct syntax of nested query in C#.
Thanx
Sajjad Ali
|
|
|
|
|
Your nested query does not make sense.
string str = "Select student_id from student_biodata where student_name = '" + lstStudentName.Text + "'";
Isn't this what you are trying to do ?
You missed quotes for student name in your orignal query.
|
|
|
|
|
1) rec = "select student_id from student_biodata where student_name = " + lstStudentName.Text + "";
2)string str = "select * from student_biodata where student_id = " + rec + "";
i want to get student_id first then i want to use id for specific record to display in data grid.
|
|
|
|
|
I assume this is homework and the fact that your code is not secure is not a problem ?
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
|
Read up on SQL injection attacks.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
Try out this:
rec = "select student_id from student_biodata where student_name = '" + lstStudentName.Text + "'";
string str = "select * from student_biodata where student_id = " + rec + "";
OR
rec = "select student_id from student_biodata where student_name = '" + lstStudentName.Text + "'";
string str = "select * from student_biodata where student_id IN " + rec + "";
Reply me whether anypone of this worked or not
|
|
|
|
|
rec = "select student_id from student_biodata where student_name = " + lstStudentName.Text + "";
string str = "select * from student_biodata where student_id IN " + rec + "";
After this code their is an other error and where data adapter filling dataset
like this is the code
da.Fill(ds)
exception is on this line then it shows error message
Incorrect syntax near the keyword 'select'
Now what to do more ?
|
|
|
|
|
might be the problem is
rec = "select student_id from student_biodata where student_name = " + lstStudentName.Text + "";
string str = "select * from student_biodata where student_id IN =" + rec + "";
don't use IN as well as = together
and put quotes for student name field
Write it like this:
rec = "select student_id from student_biodata where student_name = '" + lstStudentName.Text + "'";
string str = "select * from student_biodata where student_id IN " + rec + "";
Reply me whether it works or not
modified on Wednesday, March 4, 2009 2:39 AM
|
|
|
|
|
Dear,
rec = "select student_id from student_biodata where student_name = " + lstStudentName.Text + "";
string str = "select * from student_biodata where student_id IN " + rec + "";
After this code their is an other error and where data adapter filling dataset
like this is the code
da.Fill(ds)
exception is on this line then it shows error message
Incorrect syntax near the keyword 'select'
Now what to do more ?
|
|
|
|
|
simply try adding single quotes for student name field
rec = "select student_id from student_biodata where student_name = '" + lstStudentName.Text + "'";
string str = "select * from student_biodata where student_id = " + rec + "";
OR
string str = "select * from student_biodata where student_id IN ( select student_id from student_biodata where student_name = '" + lstStudentName.Text + "')";
|
|
|
|
|
Dear,
Still i am not accessing acquired record with your this replay i am thankful i am getting records of two students one is in Class A and second is in Class B with same name like name is ABC in both classes, now i need only one record of selecting name in list box box with student id which is primary not with same name.
Thanks
Sajjad Ali
|
|
|
|
|
|
Catch the click and open a menu.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
Yea. true.. But nowadays in from .Net 2.0 onwards i think we are having much more luxury.. that is to use a dropdown button control itself .. in this kind of situations.
I belive dropdown button is a part of Menustrip
|
|
|
|
|
Hi all,
Guys i have project for searching engine and the idea is connecting Google Desktop Search (GDS) with C# application i foud some helpfull code which search for a file and return its path like this code
using System;
using System.IO;
using System.Net;
using System.Xml;
using Microsoft.Win32;
using System.Collections;
using System.Collections.Generic;
using System.Text;
namespace ConsoleApplication1
{
class GDS
{
private string format = "&format=xml";
public GDS()
{
}
public ArrayList Search(string search, int num)
{
search = search.Replace(" ", "+");
WebClient localGDS = new WebClient();
string gdsResponse = null;
try
{
StreamReader sr = new StreamReader(localGDS.OpenRead(getSearchQuery() + search + format + "&num=" + num.ToString()));
gdsResponse = sr.ReadToEnd();
sr.Close();
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
return null;
}
ArrayList ar = new ArrayList();
if (gdsResponse != null)
{
XmlDocument xmlDoc = new XmlDocument();
try
{
xmlDoc.LoadXml(gdsResponse);
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
return null;
}
XmlNodeList resultsNode = xmlDoc.GetElementsByTagName("result");
foreach (XmlNode result in resultsNode)
{
XmlNodeList fields = result.ChildNodes;
Hashtable hash = new Hashtable();
foreach (XmlNode field in fields)
{
hash.Add(field.Name, field.InnerXml);
}
ar.Add(hash);
}
}
return ar;
}
public ArrayList SearchOnlyFiles(string search, int num)
{
search = search.Replace(" ", "+");
WebClient localGDS = new WebClient();
string gdsResponse = null;
try
{
StreamReader sr = new StreamReader(localGDS.OpenRead(getSearchQuery() + search + format + "&num=" + num.ToString() + "&flags=512"));
gdsResponse = sr.ReadToEnd();
sr.Close();
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
return null;
}
ArrayList ar = new ArrayList();
if (gdsResponse != null)
{
XmlDocument xmlDoc = new XmlDocument();
try
{
xmlDoc.LoadXml(gdsResponse);
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
return null;
}
XmlNodeList resultsNode = xmlDoc.GetElementsByTagName("result");
foreach (XmlNode result in resultsNode)
{
XmlNodeList fields = result.ChildNodes;
Hashtable hash = new Hashtable();
foreach (XmlNode field in fields)
{
hash.Add(field.Name, field.InnerXml);
}
ar.Add(hash);
}
}
return ar;
}
private string getSearchQuery()
{
RegistryKey currentUser = RegistryKey.OpenRemoteBaseKey(Microsoft.Win32.RegistryHive.CurrentUser, "");
RegistryKey searchUrl = currentUser.OpenSubKey("Software\\Google\\Google Desktop\\API");
object key = searchUrl.GetValue("search_url");
return key.ToString();
}
[STAThread]
static void Main(string[] args)
{
GDS gds = new GDS();
string words = "java";
ArrayList ar = gds.SearchOnlyFiles(words, 20);
if (ar != null)
{
foreach (object o in ar)
{
Hashtable hash = (Hashtable)o;
string category = (string)hash["category"];
if (category.Equals("file"))
{
Console.WriteLine("**********************************");
Console.WriteLine("File Found: " + (string)hash["url"]);
}
}
}
Console.ReadLine();
}
}
}
i did a complete project in java which search for a file and return many things like url,las_date_modified, and content but in c# i couldn't found a documintation talking about GDS and its ability to connect GDS API with C# application please if some interest or has usefull information for me please help...
|
|
|
|
|
This is java code ? If it's C# code, where did you get it from ? Why doesn't it work ?
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
No it is C# code but you have to donloade google dekstop search tool and install it in your machine
i am looking for some help to get solution for searching operation like i want C# code connect to GDS and give the result to user as interface
|
|
|
|