thnx alot it worked
mavii
Posts
-
sentax for C# statement whilw using SQL query -
how to use the keyword 'LIKE' in SQL query in C# code, what will be the sentax of C# statementthnx alot it worked
-
how to use the keyword 'LIKE' in SQL query in C# code, what will be the sentax of C# statementi am using ASP.net, C# anD SQL Server2005,in the following query: string q = "SELECT collapsed_building.b_name,collapsed_building.b_desc FROM collapsed_building WHERE collapsed_building.b_name LIKE '" + crimewithdate.text2 + "' "; I WANT TO USE % AFTER THE KEYWORD like SO THAT ALL THE BUILDING NAMES WHICH MATCH THE VALUE ENTERED BY THE USER ARE DISPLAYED WHEN I WRITE (LIKE '" + %crimewithdate.text2 %+ "'), IT GIVES ERROR, WHAT WILL BE THE CORRECT SENTAX
-
sentax for C# statement whilw using SQL queryi am using ASP.net, C# anD SQL Server2005,in the following query: string q = "SELECT collapsed_building.b_name,collapsed_building.b_desc FROM collapsed_building WHERE collapsed_building.b_name LIKE '" + crimewithdate.text2 + "' "; I WANT TO USE % AFTER THE Khow to use the keyword LIKE in the SQL query in C# statementEYWORD like SO THAT ALL THE BUILDING NAMES WHICH MATCH THE VALUE ENTERED BY THE USER ARE DISPLAYED WHEN I WRITE (LIKE '" + %crimewithdate.text2 %+ "'), IT GIVES ERROR, WHAT WILL BE THE CORRECT SENTAX
-
how to use the keyword LIKE in the SQL query in C# statementi am using ASP.net, C# anD SQL Server2005,in the following query: string q = "SELECT collapsed_building.b_name,collapsed_building.b_desc FROM collapsed_building WHERE collapsed_building.b_name LIKE '" + crimewithdate.text2 + "' "; I WANT TO USE % AFTER THE KEYWORD like SO THAT ALL THE BUILDING NAMES WHICH MATCH THE VALUE ENTERED BY THE USER ARE DISPLAYED WHEN I WRITE (LIKE '" + %crimewithdate.text2 %+ "'), IT GIVES ERROR, WHAT WILL BE THE CORRECT SENTAX
-
IN CRYSTAL REPORT OUTPUT EACH RECORD APPEARS 3 0r 4 TIMES REPEATINGi have not worked with stored procedure, please guide me, can u tell me the whole procedure to design crystal reports in windows application (not the web-based application)
-
URGENT: PROBLEM IN CRYTAL REPORTS OUTPUThave designed crystal reports in my project in VISUAL STUDIO.net 2005 in ASP.net, C#. i have designed database in SQL Server 2005.in crystal report i have used the SQL Query which takes records from two tables, but in output the record against the column of one table re repeating.i am also displaying my code behind crystalReportViewer1_Load as i am struggling for many days but couldnt find error, please help me find any solution.i have generated reports through crystal report wizard private void crystalReportViewer1_Load(object sender, EventArgs e) { //string strcon = "Provider=SQLOLEDB;Server=./SQLEXPRESS;DataSource=rescue15; User Instance=false; Integrated Security=true;"; string strcon = "Provider=SQLOLEDB;Server=(local);Database=rescue15;uid=sa;pwd=SASA;"; OleDbConnection conn = new OleDbConnection(strcon); //string q = "SELECT DISTINCT crime_mgmt.cr_location,crime_mgmt.cr_date,offensive_issue.c_desc FROM crime_mgmt,offensive_issue WHERE crime_mgmt.fir_num = offensive_issue.fir_num AND crime_mgmt.cr_date BETWEEN '" + crimewithdate.text + "' AND '" + crimewithdate.text1 + "'"; string q = "SELECT c.cr_date, c.cr_location, o.c_desc FROM crime_mgmt AS c INNER JOIN offensive_issue AS o ON c.fir_num = o.fir_num WHERE c.cr_date BETWEEN '" + crimewithdate.text.ToString() + "' AND '" + crimewithdate.text1.ToString() + "'"; OleDbCommand cmd = new OleDbCommand(q, conn); conn.Open(); ReportDocument rep = new ReportDocument(); string exename = Application.ExecutablePath; FileInfo exefile = new FileInfo(exename); string directory = exefile.DirectoryName; string str = HostingEnvironment.ApplicationPhysicalPath + directory + "\\CrystalReport2.rpt"; rep.Load(str); DataSet ds = new DataSet(); OleDbDataAdapter da = new OleDbDataAdapter(cmd); //da.Fill(ds); da.Fill(ds, "crime_mgmt"); da.Fill(ds, "offensive_issue"); //ds.WriteXml(directory + "\\AuthoritesWise.xml"); //ds.ReadXml(directory + "\\AuthoritesWise.xml"); rep.SetDataSource(ds); crystalReportViewer1.ReportSource = rep; conn.Close(); }
-
IN CRYSTAL REPORT OUTPUT EACH RECORD APPEARS 3 0r 4 TIMES REPEATINGi have designed crystal reports in my project in VISUAL STUDIO.net 2005 in ASP.net, C#. i have designed database in SQL Server 2005.in crystal report i have used the SQL Query which takes records from two tables, but in output the record against the column of one table re repeating.i am also displaying my code behind crystalReportViewer1_Load as i am struggling for many days but couldnt find error, please help me find any solution.i have generated reports through crystal report wizard private void crystalReportViewer1_Load(object sender, EventArgs e) { //string strcon = "Provider=SQLOLEDB;Server=./SQLEXPRESS;DataSource=rescue15; User Instance=false; Integrated Security=true;"; string strcon = "Provider=SQLOLEDB;Server=(local);Database=rescue15;uid=sa;pwd=SASA;"; OleDbConnection conn = new OleDbConnection(strcon); //string q = "SELECT DISTINCT crime_mgmt.cr_location,crime_mgmt.cr_date,offensive_issue.c_desc FROM crime_mgmt,offensive_issue WHERE crime_mgmt.fir_num = offensive_issue.fir_num AND crime_mgmt.cr_date BETWEEN '" + crimewithdate.text + "' AND '" + crimewithdate.text1 + "'"; string q = "SELECT c.cr_date, c.cr_location, o.c_desc FROM crime_mgmt AS c INNER JOIN offensive_issue AS o ON c.fir_num = o.fir_num WHERE c.cr_date BETWEEN '" + crimewithdate.text.ToString() + "' AND '" + crimewithdate.text1.ToString() + "'"; OleDbCommand cmd = new OleDbCommand(q, conn); conn.Open(); ReportDocument rep = new ReportDocument(); string exename = Application.ExecutablePath; FileInfo exefile = new FileInfo(exename); string directory = exefile.DirectoryName; string str = HostingEnvironment.ApplicationPhysicalPath + directory + "\\CrystalReport2.rpt"; rep.Load(str); DataSet ds = new DataSet(); OleDbDataAdapter da = new OleDbDataAdapter(cmd); //da.Fill(ds); da.Fill(ds, "crime_mgmt"); da.Fill(ds, "offensive_issue"); //ds.WriteXml(directory + "\\AuthoritesWise.xml"); //ds.ReadXml(directory + "\\AuthoritesWise.xml"); rep.SetDataSource(ds); crystalReportViewer1.ReportSource = rep; conn.Close(); }
-
how to fill DataAdapter when two tables are being used+ASP.Neti am providing the code below DataSet ds = new DataSet(); OleDbDataAdapter da = new OleDbDataAdapter(cmd); da.Fill(ds, "offensive_issue"); da.Fill(ds, "crime_mgmt");
-
how to fill DataAdapter when two tables are being used+ASP.Neti am providing the code below string strcon = "Provider=SQLOLEDB;Server=(local);Database=rescue15;uid=sa;pwd=sasa;"; OleDbConnection conn = new OleDbConnection(strcon); string q = "SELECT crime_mgmt.cr_location 'Crime Location',crime_mgmt.cr_date,offensive_issue.c_desc FROM crime_mgmt,offensive_issue"; OleDbCommand cmd = new OleDbCommand(q, conn); conn.Open(); DataSet ds = new DataSet(); OleDbDataAdapter da = new OleDbDataAdapter(cmd); da.Fill(ds, "offensive_issue"); da.Fill(ds, "crime_mgmt");
-
urgent: can anyone plz tell the error in santex of SQL Queryi have applied the following query but in output one record appears repeatedly, can u check whether there is any error in query santax, perhaps i have used 'AND' 2 TIMES SELECT crime_mgmt.cr_location,crime_mgmt.cr_date,offensive_issue.c_desc FROM crime_mgmt,offensive_issue WHERE crime_mgmt.fir_num = offensive_issue.fir_num AND crime_mgmt.cr_date BETWEEN '" + crimewithdate.text.ToString() + "' AND '" + crimewithdate.text1.ToString() + "'ORDER BY crime_mgmt.cr_date ASC
-
how to use the value of textBox placed on one page on to another pagecan u plz explain about how u have used session, i mean if i simply write like this, session("s1") = textBox1.Text; session("s2") = textBox1.Text; the following errors come: Error 1: Class, struct, or interface method must have a return type Error 2 Type expected Error 3 Invalid token ';' in class, struct, or interface member declaration
-
how to use the value of textBox placed on one page on to another pagecan u plz explain your following sugesstion, i am not exactly getting what to do " put the value on the URL when you navigate to the second page ( the advantage of this is that your new page becomes bookmarkable )"
-
how to use the value of textBox placed on one page on to another pagei am designing an application in ASP.Net using C# in Visual studio2005. while making crystal reports, my requirement is that when user enter any value(e.g, year) in the textBox and click the button the values according to user requiredment are displayed in report. but to load report i am writing code in "crystalReportViewer1_Load" and in query i want to use the value of textBox which is present on previous page. i have write the code as: public static string s1 = textBox1.Text; public static string s2 = textBox1.Text; and in "crystalReportViewer1_Load" i hav write string s3 = rescue15.reports.s1; string s4 = rescue15.reports.s2; but the following error comes Error 7 An object reference is required for the nonstatic field, method, or property 'rescue15.reports.textBox1' can anyone guide me plz
-
urgent copy image from hard Drive on local hoststring strQuery = ""; openFileDialog1.ShowDialog(); string s = openFileDialog1.FileName; textBox6.Text = s; st2 = s; string st = "Pict" + Guid.NewGuid().ToString() + ".jpg"; File.Copy(openFileDialog1.FileName, Path.Combine(@"c:\inetpub\wwwroot\15 website\images", st)); strQuery = "INSERT INTO criminal(pic_name) VALUES('"+System.IO.Path.GetFileName(openFileDialog1.FileName)+"')"; SqlCommand com = new SqlCommand(strQuery, conn); com.ExecuteNonQuery(); PROBLEM: error comes on this the SQL Query , am i inserting rightly? or there is some other way Actually i want to insert only picture name of the picture to be browsed can u plz suggest any solution
-
urgent: can any one plz solve my problem regading SQL Querythank you this is really working, can u suggest the solution for one more problem string strQuery = ""; openFileDialog1.ShowDialog(); string s = openFileDialog1.FileName; textBox6.Text = s; string st = "Pict" + Guid.NewGuid().ToString() + ".jpg"; File.Copy(openFileDialog1.FileName, Path.Combine(@"c:\inetpub\wwwroot\15 website\images", st)); strQuery = "INSERT INTO criminal(pic_name) VALUES(System.IO.Path.GetFileName(openFileDialog1.FileName))"; PROBLEM: error comes on this the SQL Query , am i inserting rightly?
-
urgent copy image from hard Drive on local hostcan u suggest a solution for following problem public static int count = 0; private void button3_Click_1(object sender, EventArgs e) { openFileDialog1.ShowDialog(); string s = openFileDialog1.FileName; textBox6.Text = s; string st = "Pict" + (count++) + ".jpg"; File.Copy(s.Substring(13, s.Length - 13), "C:\\Inetpub\\wwwroot\\15 WebSite\\images\\" + st);} i want the image to be saved in local host with the same name as as it was present in hard drive (from where it was browsed) ur solution regarding BLOB must be right but i cant apply it right now:(
-
urgent copy image from hard Drive on local hostcan u suggest a solution for following problem public static int count = 0; private void button3_Click_1(object sender, EventArgs e) { openFileDialog1.ShowDialog(); string s = openFileDialog1.FileName; textBox6.Text = s; string st = "Pict" + (count++) + ".jpg"; File.Copy(s.Substring(13, s.Length - 13), "C:\\Inetpub\\wwwroot\\15 WebSite\\images\\" + st);} i want the image to be saved in local host with the same name as as it was present in hard drive (from where it was browsed) i have applied ur GUID example but unfortunately its not working, can u apply this in my code?
-
urgent copy image from hard Drive on local hostur idea must be right but i cant try it now, i have tried a method, can u plz suggest solution regarding this problem openFileDialog1.ShowDialog(); string s = openFileDialog1.FileName; textBox6.Text = s; string st = "abc1" + (count++) + ".jpg"; File.Copy(s.Substring(13, s.Length - 13), "C:\\Inetpub\\wwwroot\\15 WebSite\\images\\" + st); the subctring exactly returns the name og the picture PROBLEM IS: i want the image to be saved with the same name in local host as the Substing retun name "ABC.jpg" i want to save it with the same name in local host
-
urgent copy image from hard Drive on local hostwill u plz make ur sugesstion some more clear that "give them all unique name using GUID" GUID?