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
~16.1K People Reached
Favorite Tags

52 Posted Topics

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
838
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
178
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
273
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
81
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
214
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
128
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
154
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
73
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
157
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
155
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
172
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
97
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
748
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
111
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
140
Member Avatar for uchiha203

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

Member Avatar for jugosoft
0
82
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
105
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
167
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
131
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
116
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
78
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
108
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
143
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
806
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
978
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
196
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
153
Member Avatar for c#dummie

You can set ListBox's property 'Sorted' to 'true'. If you are using an array, make sure that sorting doesn't change combination of members. If you are using an array, there is a sort function.

Member Avatar for jugosoft
0
700
Member Avatar for vedro-compota
Member Avatar for vedro-compota
0
181
Member Avatar for Prabhakar bagde

You can use '[URL="http://www.asp.net/ajaxlibrary/act.ashx"]AJAX Control Toolkit[/URL]'. There is a SlideShow control. But if you want to use Javascript(which is the harder way) you could search Google. I suggest you to use AJAX Toolkit.

Member Avatar for kvprajapati
0
69
Member Avatar for Macky Dave

You can use the following code. Code if for MS SQL Server, but if use for example Access database change "SqlConnection" to "OleDbConnection" or "OdbcConnection". [code] Private Function count() As Long SqlConnection connection = New SqlConnection("connectionString") SqlCommand command = New SqlCommand("SELECT COUNT(*) FROM tableName WHERE condition = ''",connection) SqlDataReader reader …

Member Avatar for Macky Dave
0
118
Member Avatar for ogsirus

Try with this code, I changed SQL query and parameter: [code] string connectionString = null; OleDbConnection connection; OleDbDataAdapter oledbAdapter = new OleDbDataAdapter(); string sql = null; connectionString = "Provider=Microsoft.Jet.OLEDB.4.0;" + @"data source=Book.mdb"; connection = new OleDbConnection(connectionString); sql = "delete from Books where BookKey = @BookKey"; try { connection.Open(); oledbAdapter.DeleteCommand = …

Member Avatar for ogsirus
0
187
Member Avatar for jugosoft

I have function that returns string and that works fine but when I call that function from another procedure when it executes function I get a message: [B],,Conversion from 'result' to type 'Integer' is not valid,,[/B] ASP debugger says: [B],,Input string was not in a correct format. ,,[/B] I tried …

Member Avatar for crishjeny
0
1K
Member Avatar for eladreznik

I never use ToolTips that are definder in control properties. I always make a my tooltip, here's the code: [CODE] Private toolTipInformation As New ToolTip Private Sub show() toolTipInformation.Show("some text", window) End Sub Private Sub hide() toolTipInformation.Hide(window) End Sub [/CODE] [I]window[/I] Type: System.Windows.Forms.IWin32Window The Control to display the ToolTip for.

Member Avatar for jugosoft
0
365
Member Avatar for stm4

Create a function that will check if user name exists, and if user name exists check if password is correct.

Member Avatar for tonyfonseca
0
78
Member Avatar for new SE

]You can use ASP validators. More information about them you can find on next link: [URL="http://www.w3schools.com/aspnet/aspnet_refvalidationcontrols.asp"]http://www.w3schools.com/aspnet/aspnet_refvalidationcontrols.asp[/URL]

Member Avatar for new SE
0
75
Member Avatar for subhankar02dey

I don't like to use datasets and bindings. Try with next code, ORDER BY clause is if you want to sort data from table: [CODE] Dim connection As New SqlConnection(connectionString) Dim command As New SqlCommand("SELECT * FROM table ORDER BY collumn ASC", connection) Dim reader As SqlDataReader Try connection.Open() reader …

Member Avatar for Freon22
0
166
Member Avatar for tferrier18

Here is the code: [CODE] Dim result As String result = beginingString.Text.Remove(beginingString.Text.Length - 7, 7) [/CODE]

Member Avatar for codeorder
0
169
Member Avatar for Naveed_786

If that is a SQL query, use next query: [CODE=sql] SELECT * FROM table WHERE date > 'date' AND date < 'date2' [/CODE]

Member Avatar for finito
0
93
Member Avatar for jugosoft

I have some text with Cyrillic and Latin (š, đ, č, ć, ž). How can I store that data in MS SQL 2008. I tried to store word 'Palačinka' but instead of 'č' i get 'c'.

Member Avatar for jugosoft
0
70
Member Avatar for jlego

Yes, is you want to sort data use next SQL statement: [CODE="sql"]SELECT collumnName FROM tableName[/CODE]

Member Avatar for jugosoft
0
1K
Member Avatar for jaijinendra

Create a functions that will check if username exists (SELECT * FROM table WHERE USERNAME = '" & username & "'"). If reader.Read then return True else return False. It's same code for checking password (if password = reader("PASSWORD"))..

Member Avatar for ashishkj1989
0
108
Member Avatar for jugosoft

I have some data encrypted with MD5CryptoServiceProvider. I need code for decrpyting.

Member Avatar for jugosoft
0
97
Member Avatar for mhs.praveen

Use next code: [CODE] Private Sub TextBox_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox.KeyPress Dim ascii As Integer = Asc(e.KeyChar.ToString) ' Ascii code for comma is 46 If ascii = 46 Then e.KeyChar = "," End If End Sub [/CODE]

Member Avatar for mhs.praveen
0
95
Member Avatar for Nanda1605

I don't know how to recognise the character, but this code could help you: [CODE] Imports System.Drawing ... ' image is PictureBox control Dim bitmap As New Bitmap("LOCATION TO IMAGE") Dim rectangle As New Rectangle(New Point(image.Location.X, image.Location.Y), New Size(bitmap.Size.Width, bitmap.Size.Height)) image.DrawToBitmap(bitmap, rectangle) For i = 0 To bitmap.Size.Width Step +1 …

Member Avatar for jugosoft
0
72
Member Avatar for Eleqtriq

This is for CheckedListBox: [CODE] For i = 0 To checkedListBoxName.Items.Count - 1 Step 1 checkedListBoxName.SetChecked(i, True) Next [/CODE] In ASP just write this code: [CODE] checkBox.Checked = True [/CODE]

Member Avatar for jugosoft
0
89
Member Avatar for jugosoft

I'm writting program in VB 2010, but I have a problem. I want to draw a temporary line on PictureBox control MouseMove event. That works fine but deleting of that line doesn't work. I tried to draw the white line on the same coordinates (PictureBox's background is white), but won't …

Member Avatar for ÜnLoCo
0
2K

The End.