Posts
 
Reputation
Joined
Last Seen
Ranked #1K
Strength to Increase Rep
+5
Strength to Decrease Rep
-1
100% Quality Score
Upvotes Received
9
Posts with Upvotes
9
Upvoting Members
4
Downvotes Received
0
Posts with Downvotes
0
Downvoting Members
0
5 Commented Posts
0 Endorsements
Ranked #977
~15.9K People Reached
Favorite Tags
Member Avatar for jeffreylee

[code] public void connect() { SqlConnection connection = new SqlConnection("connectionString"); try { connection.Open(); } catch { // Show error } finally { connection.Close(); } } [/code] Don't forget to add [code]System.Data.SqlClient[/code] reference to project.

Member Avatar for vdixit01
0
828
Member Avatar for rgudgeon

That maybe happens because page and master are not in the same folder. To solve this case register script file on page load.

Member Avatar for rgudgeon
0
173
Member Avatar for TheDocterd

Pass values by the class constructor: Form that you want to open: [code] ... string arg; public className(argumentThatYouWantToPass) { InitializeComponents; arg = argumentThatYouWantToPass; } ... [/code] Form that will open another form: [code] public void openForm() { Form2 form = new Form2(argument); form.Show(); } [/code]

Member Avatar for d00garuz
0
271
Member Avatar for kashyapst
Member Avatar for pshirgaonkar

I don't think that is possible on server or client side. It can be done if you modify web browser.

Member Avatar for jugosoft
0
80
Member Avatar for bhagawatshinde

If you use SQL Server Authentication (which is true this case) you must set Integrated Security parameter to false. This should work: [code] return new SqlConnection(@"Data Source=68.71.135.2,2121;Initial Catalog=DBTest;Integrated Security=False;User ID=myId;Password=mypass;"); [/code]

Member Avatar for bhagawatshinde
0
209
Member Avatar for auwi987

- Insert statement should be: [code] cmdSave.CommandText = "insert into tblMember(Std_ID,Last_N,First_N,Mid_N,Level,Section) values (@Std_ID,@Last_N,@First_N,@Mid_N,@Level,@Section)"; [/code] - You don't have to write explicity which data type is parameter (in some cases you must - very rare), and when you add parameter to SqlCommand there should be no '@' sign. [code] cmdSave.Parameters.Add(new SqlParameter("Std_ID", …

Member Avatar for Mitja Bonca
0
122
Member Avatar for Lovelake

You can limit textbox's maximum length by settings its attribute length/max length to 4 in the Properties panel.

Member Avatar for crishlay
0
151
Member Avatar for jugosoft

I'm creating multimedia player for some compatition, but I'm facing with problem with measuring audio output which is going to speaker/s. How can I measure it without some compicated code like CoreAudioApi which I found on CodeProject forum. I tried it to use but I'm getting some COM casting error.

Member Avatar for kvprajapati
0
72
Member Avatar for sarminatorius
Member Avatar for GAME

Your code in vulnerabile with SQL injection. Always use parametarised queries: [code] public void checkUsername() { string qry = "SELECT Password FROM Tablename WHERE User=@username"; using (SqlConnection conn = new SqlConnection("YourConnectionString")) { try { conn.Open(); SqlCommand cmd = new SqlCommand(qry, conn); cmd.Parameters.Add(new SqlParameter("username", userName.Text)); SqlDataReader reader; reader = cmd.ExecuteReader(); if …

Member Avatar for GAME
0
154
Member Avatar for jijo cleetus

Date that you want to insert in SQL Server database must be in format [b]MM/dd/yyyy[/b], and time must be in format [b]hh:mm:ss[/b]. Don't forget to set data type of collumn in database to [i]datetime[/i]. [code] string dateAndTime = DateTime.Now.ToString("MM/dd/yyyy hh:mm:ss"); ... command.ExecuteNonQuery(); [/code]

Member Avatar for jijo cleetus
0
150
Member Avatar for NewOrder

1. All variables declared in class are by default private. If you want that they can be visible to any method, try putting keyword public before data type. [code] public int variable1; [/code] 2. If you have location map, I think that there must be X and Y cooridnate?

Member Avatar for tripleD
0
168
Member Avatar for moshe12007

1. UserRow reference is not added to a project. If you created that class, add reference, or if that class is in .NET Framework Base Class Library add reference to it with 'using' directive. 2. After createing a new instance of any class in C# there must be () or …

Member Avatar for lolafuertes
0
96
Member Avatar for MrCapuchino

1. Generate a random number with [B]Random[/B] class. There must be an option in StreamReader/TextReader to get block from the specific location. 2. If that text file is in the same folder where application is, use just file's name eg. [code] StreamReader reader = new StreamReader("file.txt"); [/code]

Member Avatar for MrCapuchino
0
2K
Member Avatar for sureshg09

When form is submitted, SelectedIndex property is lost, you must save it with query string, session or something, and then you can use it without error. [code] Response.Redirect("page.aspx?index=" + dropDownList1.SelectedIndex); [/code] or [code] // Saving the selected index value Session["index"] = dropDownList1.SelectedIndex; // Getting selected index value string index = …

Member Avatar for jugosoft
0
732
Member Avatar for john_zakaria

[URL="http://msdn.microsoft.com/en-us/library/w4atty68.aspx"]http://msdn.microsoft.com/en-us/library/w4atty68.aspx[/URL]

Member Avatar for jugosoft
0
110
Member Avatar for denmarkstan

I created it today with CSS and javascript. Use two events - onmouseover, onmouseout. When event is triggered menu, there should be a javascript function that will show/hide submenu. [code=jscript] function show() { // To hide submenu change block to none document.getElementById("element").setAttribute("display", "block"); } [/code]

Member Avatar for jugosoft
0
127
Member Avatar for uchiha203

To download you can just use Response.Redirect() function. [code] Response.Redirect("~/file.extension"); [/code]

Member Avatar for jugosoft
0
80
Member Avatar for gabrielmusa

- I think that converting from ASP page to HTML can be done only when application is runed from server. - I suggest you to use some other element, try replacing 'iframe' with 'div', 'table' or other element that could be replace for 'iframe'.

Member Avatar for jugosoft
-1
103
Member Avatar for denmarkstan

I think he wanted to know how to create menu. Not DropDownList control. Check following links for DropDownList menu: - [URL="http://cssmenumaker.com/drop_down_css_menu.php"]http://cssmenumaker.com/drop_down_css_menu.php[/URL] - [URL="http://www.google.com/search?sourceid=chrome&ie=UTF-8&q=css+menu"]http://www.google.com/search?sourceid=chrome&ie=UTF-8&q=css+menu[/URL]

Member Avatar for denmarkstan
0
165
Member Avatar for vedro-compota

Global variable is variable that is visible to all methods in class. In VB they can be visible to all classes. [URL="http://en.wikipedia.org/wiki/Global_variable"]http://en.wikipedia.org/wiki/Global_variable[/URL]

Member Avatar for vedro-compota
0
129
Member Avatar for sam1

Try with this: [code] public System.Drawing.Image LoadImagePiece(string imagePath, Rectangle desiredPortion) { using (Image img = Image.FromFile(path)) { Bitmap result = new Bitmap(desiredPortion.Width, desiredPortion.Height, PixelFormat.Format24bppRgb); using (Graphics g = Graphics.FromImage((Image)result)) { g.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.HighQualityBicubic; g.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.HighQuality; g.PixelOffsetMode = System.Drawing.Drawing2D.PixelOffsetMode.HighQuality; g.CompositingQuality = System.Drawing.Drawing2D.CompositingQuality.HighQuality; g.DrawImage(img, 0, 0, desiredPortion, GraphicsUnit.Pixel); } return result; …

Member Avatar for jugosoft
0
113
Member Avatar for erum

[code] private string convertDate(string dateToConvert) { DateTime date = Convert.ToDateTime(dateToConvert); return date.ToString("MM/dd/yyyy"); } [/code]

Member Avatar for jugosoft
-1
77
Member Avatar for gouriarun

Every time you update database with some data, send new e-mail: [code] try { MailMessage mail = new MailMessage(); SmtpClient SmtpServer = new SmtpClient("smtpServer"); mail.From = new MailAddress(""); mail.To.Add(""); mail.Subject = ""; mail.Body = ""; SmtpServer.Port = 587; SmtpServer.Credentials = new System.Net.NetworkCredential("username", "password"); SmtpServer.EnableSsl = true; SmtpServer.Send(mail); } catch (Exception …

Member Avatar for jugosoft
0
106
Member Avatar for destruct0

I would use following query to check if there is a user with same username exists. Check can be performed with 'if' statement and reader.Read() function. [code=sql]SELECT * FROM table WHERE username = @username[/code] MitjaBonca is right.

Member Avatar for destruct0
0
141
Member Avatar for kureiki

You don't have to use ' character in T-SQL query except in data that you want to insert into table. [code=sql]INSERT INTO table (column1, column2, column3, ...) VALUES('', '', '', ...)[/code]

Member Avatar for jugosoft
0
799
Member Avatar for tarwara

You use default creditians, and you specified to use your creditians. That could be why the error is generated. Change following section of your code to: [code] protected void btnSend_Click(object sender, EventArgs e) { try { MailMessage mm = new MailMessage(); SmtpClient smtp = new SmtpClient(); mm.From = new MailAddress(txtFrom.Text); …

Member Avatar for jugosoft
0
971
Member Avatar for jugosoft

I'm creating some barcode generator, and I want to save generated barcode to database, but I have a problem when I want to get bytes from PictureBox Image. It says that Image property is null. That's hapening because barcode is drawn on the PictureBox(not in Image property). I think that …

Member Avatar for jugosoft
0
193
Member Avatar for Skul'l

You need to specify the download location. That means instead: "C:\\Users\\Skull\\Desktop" you need to put "C:\\Users\\Skull\\Desktop\\Lsusb.tar.bz2". Here's the documentation: [url]http://msdn.microsoft.com/en-us/library/ez801hhe(v=VS.100).aspx[/url]

Member Avatar for williamrojas78
0
152