|
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
|
|
|
|
|
What is the way of displaying repeating multiple records and also grouping of that repeating records in HTML reports.
Earlier i was using Crystal reports and there was not at all any problem but due to some restrictions i am supposed to use HTML reports.
These multiple rows are saved in the database just i have to display it.
Help me as i am in a critical situation 
|
|
|
|
|
Tooo Basic .. Get familiar or atleast go through some Sql basic stuff.. I believe you have to use "GroupBy" and "Orderby" clauses Properly in your query
|
|
|
|
|
I think u did'nt get my question.
The best example to explain the issue is u go to any garment shop and purchased 4 different kind of shirts and atleast 2 sizes of each kind of shirt from that same shop.The shopkeeper gives u itemized bill.
In the database of that particular shop there would a normalized Item table to avoid repeat entries(as 1 CustomerID contains more than 1 record and that 1 record contains more than 1 sizes).
That cash memo that u get is a kind of report.
In the same way i need to display in that bill all the 4 shirts purchased with customerID which is not repeating and also "groupby" by each item to display each one's sizes respectively purchased and i.e in a HTML reports.
This is it.
Please give solutions for that
|
|
|
|
|
I am doing a project which is about
Generation of html to pdf (Encryption of MULTIPLE MARKED text included, PDF document must be at least 10 pages and encryption is to be done on each page)
I am using example: ID = 1 to encrypt the text
Can anyone help me as i do not understand how to use Itext for my project.
======================================================================================================
Is like the words that are encrypted in the HTML are being hidden.
After that, i need to generate it into a pdf.
example: This is an anple
After i encrypted "This is"
In the html file <encrypted ID = 1> This is </encrypted>
After it had been generate into pdf, it will show:
<<encrypted>> an apple
This can be done into multiple encryption (more than 1 page)
So how can i do this using Itext?
Itext: iText is a library that allows you to generate PDF files on the fly.
But how do i use it?
======================================================================================================
Thank you
modified on Wednesday, March 4, 2009 1:58 AM
|
|
|
|
|
What is itext ? If your html is encrypted, how can you expect to make it into a PDF ? Why MUST the PDF be 10 pages ?
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
Hi,
I have a dataset that contains information froma database. The database has 3 columns named GlobalId, LocalId and Name. Basically the GlobalId is Autoincrimented and the LocalId is not. When I create an entry I want to check if there's a LocalId, if not then add a LocalId, if there is a LocalId then select the last one and incriment that number by 1.
My code looks like this at the moment:
private void GenerateEmployeeID()
{
int employeeID = 0;
DataTable dt = dsWBGTS.Tables["Person"];
if (dt.Rows[0][1].ToString() == "")
{
employeeID++;
lblLocalIdResult.Text = employeeID.ToString();
}
}
How can I retrieve the last number in the LocalId column and incriment that number by one?
Thank you!!
Illegal Operation
|
|
|
|
|
Well, for the local id to have meaning, it should always exist in the DB, shouldn't it ?
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
And that is why I am having this issue, because the method I am implimenting in my application should get the last LocalId entry from the dataset and incriment it by 1. The Dataset contains the latest information from the DB so obviously the LocalId will be relevant to the DB.
Illegal Operation
|
|
|
|
|
If your application has only one user, ever, then there's no issue with data traffic. So, ask the database. If your app has more than one user, then this approach is a disaster, so you need to ask the database to assign a number, and create the record, so the number doesn't get used twice.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
you could do 'select' to get your last entry or have somewhere in your database where you keep localID value
Yusuf
|
|
|
|
|
The new id is probably an identity field in your data set. The best way to get the correct id value will be to commit the updates to the database, otherwise you will have concurrency issues.
If you really want to get the last id value from the DataTable look into the Select method.
|
|
|
|
|
first of all u get max of localid and then increament 1
|
|
|
|
|
i cannot understand...image index mean just a index of image or...it carry together with image also...???? i mean, is image index contain the image that related to index?????
if i call image index could i able to get the image????
A S E L A
|
|
|
|
|
|
|
Sit back and think as to what you want to do.
imagelist
A S E L A wrote: imagelist1.Images.Add(???????????????????)
what do you think 'Add' takes as parameter? It got to be an Image Object. Don't you think?
Now look at your
A S E L A wrote: foreach(listViewItem each in listView1.SelectedItems)
ListView is just a collection of, well, items. You got your selected index, kewl, now go get your Item. What kind of object is your item? Is it am image? if not not what do you need to do to convert it to Image? Now take that Image object and give it Add().
I'm not working on windows forms, but it does not take much to figure it out. What I said may not be entirely correct, but should give you general idea.
Yusuf
|
|
|
|
|
hi yusuf
thanks a lot to ur reply it perfect....
i need to ask one more question
on application run time....when i bring my curser to "each" it shows listview:- ListViewItem:{****(name of image)***.jpeg}
so can i use that to conver to image ???
actualy im new to programming....thanks 4 ur help....
A S E L A
|
|
|
|